halohalo
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
u295559686
/
domains
/
stanjo.in
/
public_html
/
Upload FileeE
HOME
<?php $conn = mysqli_connect('localhost', 'root', '', 'stanjo'); $assignments = [ 'Panel' => 18, 'Downlight' => 19, 'Tube' => 20, 'Bulb' => 21, 'Street' => 5, 'Flood' => 22, 'Garden' => 23, 'Wall' => 24, 'Hanging' => 25, 'High Bay' => 26, 'Low Bay' => 27, 'Strip' => 16 ]; foreach ($assignments as $keyword => $catId) { $res = mysqli_query($conn, "UPDATE products SET category_id = $catId WHERE title LIKE '%$keyword%' OR description LIKE '%$keyword%'"); echo "Updated products for $keyword to Category $catId\n"; } // Special case: Industrial mysqli_query($conn, "UPDATE products SET category_id = 17 WHERE (title LIKE '%Industrial%' OR description LIKE '%Industrial%') AND category_id NOT IN (5, 22, 23, 26, 27)"); // Special case: Ceiling mysqli_query($conn, "UPDATE products SET category_id = 9 WHERE (title LIKE '%Ceiling%' OR description LIKE '%Ceiling%') AND category_id NOT IN (18, 19)"); ?>