I am using Apache 2, MySQL 4.1.3b, and PHP 5 on a Windows 2000 machine. All other scripts work except connecting to MySQL. The code I am tyring to run is as follows:
<html>
<body>
<?php
$host='localhost';
$user='storeOne';
$pw='storeOnePassl';
$db='store';
$connect = mysql_connect($host, $user, $pw) or die ("Could not connect.");
mysql_select_db($db);
$table1='products';
$table2='inventory';
$prod_statement = "INSERT INTO $table1 VALUES('$item_no', '$product','$prod_desc','$price')";
$inv_statement="INSERT INTO $table2 VALUES('$item_no','$quantity')";
if(mysql_query($prod_statement, $connect)){
print "Item added successfully.<br/>";
}
else {print "Item addition failed.<br/>";}
if(mysql_query($inv_statement,$connect)){
print "Quantity for item added successfully.<br/>";
}
else {print "Quantity addition failed.<br/>";}
?>
<h2>Product Saved</h2>
<a href='item_entry.html'>Add Another</a/
</bod>
</html>
I am new to PHP but not to MySQL. Your help is very much appreciated.
Asfaw