ok. heres my php script at the moment. Obviously i will need to change my username and password back when running the script. can you see any error with the connection request??
<?php// open connection to MySQL server$connection = mysql_ connect('localhost', 'username', 'password') ~or die ('Unable to connect!');// select database for usemysql_ select_ db('db_name') or die ('Unable to select database!');// create and execute query$query = 'SELECT * FROM Bars';$result = mysql_ query($ query) ~or die ('Error in query: $query. ' . mysql_ error());// check if records were returnedif (mysql_ num_ rows($ result) > 0){// print HTML tableecho '<table width= 100% cellpadding= 10 cellspacing= 0 border= 1>';echo'<tr>< td>< b> ID</ b></ td>< td>< b> Name</ b></ td>< td>< b> Price</ b></ td></ tr>';// iterate over record set// print each fieldwhile($ 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{// print error messageecho 'No rows found!';}// once processing is complete// free result setmysql_ free_ result($ result);// close connection to MySQL servermysql_ close($ connection);?>