Here is what I tried first:
<?
$dbhost = "localhost";
$dbuser = "odbc";
$dbpass = "";
$dbname = "products";
//connect
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("$dbname",$db);
//query
$sql = mysql_query("SELECT * FROM products WHERE part_num ='$part_num'");
//get data and put in table
while($row=mysql_fetch_row($sql))
{
$part_num = $row[277082];
$description = $row[1];
$cost = $row[2];
$qoh = $row[3];
print ("<table>\n");
print ("<tr>\n<td>$part_num</td>");
print ("<td>$description</td>");
print ("<td>$cost</td>");
print ("<td>$qoh</td>");
print ("</tr>\n</table>\n");
}
?>
Then I tried this select command: "SELECT descr FROM products WHERE part_num = 277082." This gave an output of "Resource ID#2."
<?
$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[27700];
print ("<table>\n");
print ("<tr>\n<td>$sql</td>");
print ("<tr>\n<td>$row</td>");
print ("</tr>\n</table>\n");
?>
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).
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*
Thanks for all the help!!