0

Hi Guys,

I have this piece of code that should basically retrieve the priduct ID and display the producton a different page when clicked.

I must be doing something wrong because I keep getting "nothing selected" even though the product ID is selected(also displayed on the url(www....../productview.php?prodid=1)

    <?php

          $product_id = $_GET["productID"];
          include_once("connect.php");

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
    }

          if(!isset($product_id))
          {
              print("No book selected !");
              return;
          }
$query_products = "SELECT * FROM items WHERE  productID = $product_id";

 $query_product_result = mysqli_query($db, $query_products)

            or die(mysql_error()); 

          $num_rows_products = mysqli_num_rows($query_product_result);
      ?>
2
Contributors
3
Replies
10
Views
2 Years
Discussion Span
Last Post by DaveAmour
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.