473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Fetch_array: Invalid result resource

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
*******************
<?php
$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
database.");

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

May 19 '07 #1
1 2083
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Ziebart | last post by:
Hi ! The following PHP-Code: >> $conn=pg_connect ($conn_string); >> $query=pg_exec ($conn, $sql_statement); // it's pg_query for PHP >4.2.0 >> pg_close ($conn);
6
by: Michael Winter | last post by:
The following declaration was posted to a forum: cursor: url('path/some.cur'), hand, pointer, text, default; and I'm having a hard time convincing the poster that it's invalid. First of all,...
1
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the...
9
by: Petr Vileta | last post by:
Hi, I'm new here and excuse me if this question was be here earlier. I have a simple code <html><body> <?php <?php $link = mysql_connect("localhost", "user", "password") or die("Grr: " ....
7
by: Jerim79 | last post by:
I am trying to incorporate a random quote feature on my website. I have a database table called random_quote with two columns. Column 1 is MessageID and column 2 is Message. Message contains...
2
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
3
by: JRough | last post by:
I want to save two variables in a $_SESSION for use in another page: $_SESSION = $mark; $_SESSION = $num; then on the other page I did this to get the value: $mark =$_SESSION; $num =...
3
by: BOMEz | last post by:
Hi everyone, I have a form which updates some info in a DB. Currently the user does a search, which will load up results, which the user can change, and then submit those changes back into the DB....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.