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);
      ?>

Recommended Answers

All 3 Replies

You have prodid in your url. You are getting productID though in your code.

Thanks DaveAmour!

Your welcome, a nice easy one for a change!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.