halohalo
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
u295559686
/
domains
/
stanjo.in
/
public_html
/
Upload FileeE
HOME
<?php $conn = mysqli_connect('localhost', 'root', '', 'stanjo'); // Fix existing mysqli_query($conn, "UPDATE categories SET title='Ceiling Lights', slug='ceiling-lights' WHERE id=9"); mysqli_query($conn, "UPDATE categories SET title='Industrial Lights', slug='industrial-lights' WHERE id=17"); // Missing categories $missing = [ ['title' => 'Panel Lights', 'slug' => 'panel-lights'], ['title' => 'Downlights', 'slug' => 'downlights'], ['title' => 'Tube Lights', 'slug' => 'tube-lights'], ['title' => 'Bulbs', 'slug' => 'bulbs'], ['title' => 'Flood Lights', 'slug' => 'flood-lights'], ['title' => 'Garden Lights', 'slug' => 'garden-lights'], ['title' => 'Wall Lights', 'slug' => 'wall-lights'], ['title' => 'Hanging Lights', 'slug' => 'hanging-lights'], ['title' => 'High Bay Lights', 'slug' => 'high-bay-lights'], ['title' => 'Low Bay Lights', 'slug' => 'low-bay-lights'] ]; foreach ($missing as $cat) { $title = $cat['title']; $slug = $cat['slug']; // Check if exists $res = mysqli_query($conn, "SELECT id FROM categories WHERE slug='$slug' LIMIT 1"); if (mysqli_num_rows($res) == 0) { mysqli_query($conn, "INSERT INTO categories (title, slug, status, created_at) VALUES ('$title', '$slug', 1, NOW())"); echo "Inserted: $title\n"; } else { echo "Exists: $title\n"; } } ?>