By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Fetch_array: Invalid result resource

P: n/a
Any suggestion as to why my fetch_array is bad?

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /home/jkokko/public_html/ask/test.php on line 11
$dbHost = "localhost";
$dbUser = "user";
$dbPass = "pass";
$dbDatabase = "dbname";
//connet to the database
$db = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die ("Error
connecting to database.");
mysql_select_db("$dbDatabase", $db) or die ("Couldn't select the

$result = "SELECT a_uid FROM `answers` WHERE `qid` = '13' LIMIT 0, 30,
while ($r = mysql_fetch_array($result)) {
echo $r;

May 19 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On May 18, 10:10 pm, Akhenaten <jonko...@gmail.comwrote:
Any suggestion as to why my fetch_array is bad?
17 hours a day is too much. Changed the code to:
$result = "SELECT `a_uid` FROM `answers` WHERE `qid` = '13'";
$query = mysql_query($result, $db);
while ($item = mysql_fetch_array($query)) {
echo $item[a_uid];

and we now run ok..... I gotta get some sleep |-}

May 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.