<?php
$user="root";
$pass="";
$db="inventory";
$link=mysql_connect("localhost",$user,$pass);
if(!$link)
die("couldn't connect to mysql");
print "successfully connected to mysql<p>";
mysql_select_db($db)
or die("i cant take it anymore ".mysql_error());
print "successfully selcted database \"$db\"<p>";
$query="insert into product(product_id,name,price) values('','Apple
powermac g5','2500.00')";
mysql_query($query,$link) or die("could't add data to \"product\"
table: ".mysql_error());
$result=mysql_query("select * from product");
$num_rows=mysql_num_rows($result);
print "there are currently $num_rows is the table<p>";
print "<table boder=1>\n";
while($a_row=mysql_fetch_row($result))
{
print "<tr>\n";
foreach($a_row as $field)
print "\t<td>$field<\td>\n;
print "</tr>\n"
}
print"<table>\n";
mysql_close($link);
?>
display
CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are: