Jump to content

connection error???


NIPS

Recommended Posts

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 use
mysql_ 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 returned
if (mysql_ num_ rows($ result) > 0)
{

// print HTML table
echo '<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 field
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
{
// print error message
echo 'No rows found!';
}
// once processing is complete
// free result set
mysql_ free_ result($ result);
// close connection to MySQL server
mysql_ close($ connection);
?>


</body>
</html>

[/code]

any help would be great!
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.