| marito 2004-04-10, 5:33 pm |
| Hi there! I just registered on this forum. I was trying to acces a
database that I recently created, this is my first time ever!.
There syms to be a problem with the script
<?php
db =
mysql_connect("localhost","root","pass");
mysql_select_db("mybuddy",db);
//replace the above values with your actual database values
sql_result = mysql_query("SELECT joke_no, joke FROM
jokes", db);
while(rs = mysql_fetch_array(sql_result))
{
echo "Joke No: rs[0]<BR>";
echo
str_replace("n","<BR>",rs[1]);
echo "<P>";
}
?>
I used the root and
password from my localhost.
This is the error I get when trying to connect
Warning: mysql_fetch_array(): supplied argument is not a valid
MySQL result
resource in /home/fstoresc/public_html/php/jokes.php on
line 17
Any
suggestions? Thank you
----------------------------------------
The
post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums
|