Board index   FAQ   Search  
Register  Login
Board index php forum :: Database phpMyAdmin

Warning: mysql_fetch_array(): supplied argument not a valid

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

Postby DoppyNL » Wed Nov 06, 2002 6:53 am

This is an english forum, please post your question in english then we may be able to answer your question.


what I can conlude from the (englisch) error message is that your query failed. check the syntax of the query you executed.

Greetz Daan

/me thinks "Funny how french people allways think that everyone speaks french."
DoppyNL
 

Postby Jay » Wed Nov 06, 2002 8:28 am

DoppyNL wrote:This is an english forum, please post your question in english then we may be able to answer your question.


what I can conlude from the (englisch) error message is that your query failed. check the syntax of the query you executed.

Greetz Daan

/me thinks "Funny how french people allways think that everyone speaks french."

/me think it's funny how people who can speak english can't spell it :D :wink:
Jay
 

me = have same problem

Postby Joel » Fri Mar 28, 2003 3:00 am

Yeah, I'm getting that same trouble. I think my error is in this part...

$first = $_GET["first"];

if ($first) {

$result = mysql_query("SELECT * FROM employees WHERE first=$first",$db);


$myrow = mysql_fetch_array($result);

can anyone see an error in that?
Joel
 

to Joel

Postby Renee » Tue Apr 15, 2003 7:22 am

check the value of $first. If it is alright, add single quote to $first in the query and try.
Renee
 

Postby bezmond » Tue Apr 15, 2003 7:48 am

$result = mysql_query("SELECT * FROM employees WHERE first='$first'");

that should work, if not...
echo $first;

check that $first as been set ok...

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

mysql_fetch_array(): supplied argument is not a valid MySQL

Postby ProZ » Thu Jul 31, 2003 11:18 am

Greetings all.

I am new to this forum and to learning PHP. I am currently also learning perl script. I hope I can get my problems described properly but please bear with me.

Here is the issue I have. I installed a petition on my website and it seems to work for the most part.

I can view the pages ok but there appear to be some argument inconsistencies or incorrect variable readings occurring that result in errors like this:


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/forbidz/public_html/petition/functions.php3 on line 201


Here is the section that contains line 201:


function recentSignatures() {
global $recent_signatories, $individuals_query;
echo "<strong>$recent_signatories</strong>\n<br><UL><em>";
$sql = "SELECT FirstName,LastName,City,State,Country FROM phPetition WHERE Public='on' AND confirmDate IS NOT NULL ORDER BY confirmDate DESC LIMIT 0,15";
$individuals_query = mysql_query($sql);
while ($individuals_array = mysql_fetch_array($individuals_query)) {
echo "<LI>" . stripslashes($individuals_array["FirstName"]) . " "
. stripslashes($individuals_array["LastName"])
. " $from ";
echo stripslashes($individuals_array["City"]) . " ";
echo stripslashes($individuals_array["State"]) . " ";
// echo "stripslashes($individuals_array["Country"]);
}
echo "</em></UL>";
}



This is line 201:
while ($individuals_array = mysql_fetch_array($individuals_query)) {



Here are the settings from the functions.php file: (I did not change these settings at all yet)

$params['host'] = 'bangalore.flora.ca'; // The smtp server host/ip
$params['port'] = 25; // The smtp server port
$params['helo'] = exec('hostname'); // What to use when sending the helo command. Typically, your domain/hostname
$params['auth'] = FALSE; // Whether to use basic authentication or not
$params['user'] = 'testuser'; // Username for authentication
$params['pass'] = 'testuser'; // Password for authentication



I do not think the database is working properly but this is just my guess. I know it's there because I created it. How do I know what to call the tables and what information should be in each one? If the script is interacting properly with the DB, shouldn't the tables get created when I run the script?


I may be totally wrong. I do not know enough to say for sure.


Does anyone see what I should change? If I need to show more code, just let me know what you need to see and I will put a link to a text file for easy viewing.


I hope I can get this working. The petition is against the RIAA for suing downloaders.


Best regards,

Pro Z :?:
ProZ
New php-forum User
New php-forum User
 
Posts: 2
Joined: Thu Jul 31, 2003 10:23 am

Postby Redcircle » Thu Jul 31, 2003 11:17 pm

check to make sure your mysql statement is valid and there are no misspelled words.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby sigix » Mon Aug 04, 2003 4:18 am

try to echo all the values (major on which your query is working) on the next page then you can easily spot the problem
if you are not getting the values then there is problem in your receiving end ...
get values with single quot $name=$HTTP_POSTVARS[''];;;; :arrow:
sigix
php-forum Active User
php-forum Active User
 
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron