Short background... relatively new to PHP and was given a project to integrate it with a MySQL db basically just to produce reports on inventory. I had to run a query and return a value from a column. This value was then in turn passed through a hyperlink to another page as 'id'.
When I am on the new page --- I can echo $id and the value that was passed is correct. However when I try to run a mysql query using the $id variable I get nothing back. The minute I code in any text I know is in the table I am querying it works.!!!.. I have been working on this for hours and have tried every variation I could think of??? Could someone please direct me to something I am missing...
Here is the code I am using:
<?php
echo $id;
printf ("<div align=center>
<table width=600 border=1>
<tr align=center bgcolor=#999999><td>Part #</td><td>Quantity</td><td>Jobber</td><td>Extended</td><td>Part #</td><td>Quantity</td><td>Jobber</td><td>Extended</td><td>Part #</td><td>Quantity</td><td>Jobber</td><td>Extended</td>");
$result = mysql_query("SELECT * FROM `STORE_TEST` WHERE `ASC`='$id' ORDER BY `PART_NO`");
?>
as I said the previous page that links to this passes the $id through a hyperlink that is generated from a return on a query. I have tried "", [], removing quotes.. etc around the variable in the query but it will not work. I have also tried mysql_real_escape_string() etc just in hopes it might work. Have I done something wrong... I really need help because once I figure this out the project can be completed.