Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MySQL returned an empty result set (i.e. zero rows).


urbantime

Recommended Posts

Please how do i solve this issue? MySQL returned an empty result set (i.e. zero rows).  Here are my codes:

 

<?php
if(isset($_POST['submit'])){

    $product_title = $_POST['product_title'];
    $product_cat = $_POST['product_cat'];
    $cat = $_POST['$cat'];
    $product_price = $_POST['product_price'];
    $product_keywords = $_POST['product_keywords'];
    $product_desc = $_POST['product_desc '];

    $product_img1 = $_FILES['product_img1']['name'];
    $product_img2 = $_FILES['product_img2']['name'];
    $product_img3 = $_FILES['product_img3']['name'];

    $temp_name1 = $_FILES['product_img1']['tmp_name'];
    $temp_name2 = $_FILES['product_img2']['tmp_name'];
    $temp_name3 = $_FILES['product_img3']['tmp_name'];

    move_uploaded_file($temp_name1, "product_images/$product_img1");
    move_uploaded_file($temp_name2, "product_images/$product_img2");
    move_uploaded_file($temp_name3, "product_images/$product_img3");

$insert_product = "INSERT INTO products (p_cat_id,cat_id,date,product_title,product_img1,product_img2,product_img3,product_price,product_keyword,product_desc) VALUES('$product_cat','$cat',NOW(),'$product_title', '$product_img1','$product_img2','$product_img3','$product_price','$product_keywords','$product_desc') ";

    $run_product = mysqli_query($connect,$insert_product);

    if($run_product){

        echo "<script>alert('Product has been inserted successfully')</script>";
        echo "<script>window.open('insert_product.php','_self)</script>";
    }
}
?>

Please can sombody help me???

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...