I am uses the below php coding to access a mysql database. Currently it is on a localhost system, just for trial before it gets on the web. I need some help with the coding! What I am trying to accomplish is in the next paragraph. I also need to know why I am getting a blank page, or with a few mods to the coding I get "Resource ID#2" Does it have to do with using ODBC on the localhost system?
I am looking to get specific pieces of information from a certain product number (prod_num). Like the Description (desr), price (cost - which will have a percentage added to it), status (stock), etc.
Here are all of the rows in the "products" database - I am not going to use all of the rows, I have marked useless ones with a star: grp, cat,sub, vend_code, manu_part, part_num, descr, cost, retail, qty, list_price, eff_date, tech_fax, status, ups*
<?
$dbhost = "localhost";
$dbuser = "ODBC";
$dbpass = "";
$dbname = "products";
//connect
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("$dbname",$db);
//query
$sql = mysql_query("SELECT descr FROM products WHERE part_num ='$part_num'");
//get data and put in table
while($row=mysql_fetch_row($sql))
$part_num = $row[27];
print ("<table>\n");
print ("<tr>\n<td>$sql</td>");
print ("<tr>\n<td>$row</td>");
print ("</tr>\n</table>\n");
?>
Thanks for all the help!