Original Post
ok, i'm having problems connecting to a data base using PHP, i'm using the book "How To Do Everything in PHP and mySQL" and its not working, so i'm wondering if someone can look at hte code and see if i'm messing up somewhere. thanks
<?php
$connection = mysql_connect('localhost','root','password1') or die('Connection Error');
mysql_select_db('hughie') or die('can't Find to database');
$query = 'SELECT * FROM items';
$result = mysql_query($query); or die('No Results');
if(mysql_num_rows($result) > 0)
{
echo '<table width=100% CELLPADDING=0 BORDER=1>';
echo '<tr><td>ID</td><td>NAME:</td><td>PRICE</td></tr>';
while($row = mysql_fetch_row($result))
{
echo '<tr>';
echo '<td>' . &row[0] . '</td>';
echo '<td>' . &row[1] . '</td>';
echo '<td>' . &row[2] . '</td>';
echo '</tr>';
}
echo '</table>';
}
else
{
echo ' No Records Could Be Found';
}
mysql_free_result('$result');
mysql_close($connection);
?>