ive uploaded the script into my file transfer folder.
The problem being is when i run my site, i recieve this message
""You don't have permission to access / on this server."
Any ideas??
Edited by shredder, 12 April 2006 - 11:22 AM.
| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Posted 12 April 2006 - 11:21 AM
Edited by shredder, 12 April 2006 - 11:22 AM.
Posted 12 April 2006 - 02:03 PM
Posted 12 April 2006 - 03:58 PM
Posted 13 April 2006 - 02:07 PM
<?php
// open connection to MySQL server
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');
// select database for use
mysql_ 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 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);
?>
Edited by shredder, 13 April 2006 - 02:07 PM.
Posted 13 April 2006 - 02:37 PM
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');
while($ row = mysql_ fetch_ row($ result)) $result = mysql_ query($ query) ~ // another tilde chaacter here??? if (mysql_ num_ rows($ result) > 0)
Posted 13 April 2006 - 02:51 PM
jlhaslip, on Apr 13 2006, 03:37 PM, said:
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');
while($ row = mysql_ fetch_ row($ result)) $result = mysql_ query($ query) ~ // another tilde chaacter here??? if (mysql_ num_ rows($ result) > 0)

0 members, 1 guests, 0 anonymous users