NIPS Posted April 10, 2006 Share Posted April 10, 2006 hi guys, just trying to display some information from my mysql database and have come across this error message."You don't have permission to access / on this server."here is my code[code]<html><head><title>Magalluf Uncut</title></head><body><?php// open connection to MySQL server$connection = mysql_ connect('localhost', '12725', 'password') ~or die ('Unable to connect!');// select database for usemysql_ select_ db('12725') 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);?></body></html>[/code]any help would be great! Quote Link to comment https://forums.phpfreaks.com/topic/7039-connection-error/ Share on other sites More sharing options...
trq Posted April 10, 2006 Share Posted April 10, 2006 Its not a connection error. It meens you dont have permissions to view pages in your webs root directory. What server are you using? Quote Link to comment https://forums.phpfreaks.com/topic/7039-connection-error/#findComment-25562 Share on other sites More sharing options...
NIPS Posted April 11, 2006 Author Share Posted April 11, 2006 im using a free host which uses a linex server. any ideas?? Quote Link to comment https://forums.phpfreaks.com/topic/7039-connection-error/#findComment-25800 Share on other sites More sharing options...
trq Posted April 11, 2006 Share Posted April 11, 2006 Are you sure php is installed? Quote Link to comment https://forums.phpfreaks.com/topic/7039-connection-error/#findComment-25854 Share on other sites More sharing options...
NIPS Posted April 11, 2006 Author Share Posted April 11, 2006 it should be as the free host supports php and offers phpadmin as a service. it does say that "You should upgrade to PHP 4.1.0 or later" in the php admin section. how do i know what version this php script is? Quote Link to comment https://forums.phpfreaks.com/topic/7039-connection-error/#findComment-25880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.