Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jason Wong
On Wednesday 07 April 2004 23:16, Andy B wrote:

> anybody know why that is or what the deal is... i had to modify the query
> set to read:
> mysql_connect(...)||die(mysql_error())//works
> $EditQuery="select * from $EventsTable where Id='$edit'";
> $query=mysql_query($EditQuery);//||die(mysql_error())
> //taken out (bug or something??)
> mysql_error();//have no clue why its even there it will
> //never get ran...
> im running php 4.3.3 if it makes any difference on that part

Please post the *full* and *concise* code which illustrates your problem.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It's a funny thing that when a woman hasn't got anything
on earth to worry about, she goes off and gets married.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Andy B
>[snip]
>i have this query set:
>$EditQuery="select * from $EventsTable where >Id='$edit'";
>$query=mysql_query($EditQuery)||die(mysql_error());
>[/snip]
>
>You forgot the connection string arguement in >mysql_query
even after putting in my standard mysql_connect(.) stuff it still fails
now the interesting  thing here: normally i can do any mysql valid functions
in php and append "||die(//whatever);" after it... but for some really odd
reason mysql_query has a fit when i do that and for some reason it thinks im
appending the litteral string "warning:" to the query itself...

anybody know why that is or what the deal is... i had to modify the query
set to read:
mysql_connect(...)||die(mysql_error())//works
$EditQuery="select * from $EventsTable where Id='$edit'";
$query=mysql_query($EditQuery);//||die(mysql_error())
//taken out (bug or something??)
mysql_error();//have no clue why its even there it will
//never get ran...
im running php 4.3.3 if it makes any difference on that part

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread John W. Holmes
From: "Andy B" <[EMAIL PROTECTED]>

> i have this query set:
> $EditQuery="select * from $EventsTable where Id='$edit'";
> $query=mysql_query($EditQuery)||die(mysql_error());
> //later in the code i have this:
> while($old=mysql_fetch_array($query)){
> //do stuff
> }
> when i run the page i get:
> warning: supplied argument to mysql_fetch_array is not a valid mysql
> resource type on line 98

You must be overwriting $query somewhere before you use it in
mysql_fetch_array(). Do a var_dump() on $query just before you try to
retrieve rows from it.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread John Nichel
Andy B wrote:
i have this query set:
$EditQuery="select * from $EventsTable where Id='$edit'";
$query=mysql_query($EditQuery)||die(mysql_error());
//later in the code i have this:
while($old=mysql_fetch_array($query)){
//do stuff
}
when i run the page i get:
warning: supplied argument to mysql_fetch_array is not a valid mysql
resource type on line 98
im lost i wrote this code hundreds of times and it always works... the query
looks right :
echo $EditQuery;
output: select * from rnjresort.events where Id='1'
and that is exactly what i want (i ran that exact string in mysql client)
and it gave me what i was looking for...
Did you select a database to run you query on?

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jason Wong
On Wednesday 07 April 2004 22:56, Andy B wrote:
> i have this query set:
> $EditQuery="select * from $EventsTable where Id='$edit'";
> $query=mysql_query($EditQuery)||die(mysql_error());
> //later in the code i have this:
> while($old=mysql_fetch_array($query)){
> //do stuff
> }
> when i run the page i get:
> warning: supplied argument to mysql_fetch_array is not a valid mysql
> resource type on line 98

Apparently $query contains something invalid, find out what it is and WHY.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It's hard to think of you as the end result of millions of years of evolution.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jay Blanchard
[snip]
i have this query set:
$EditQuery="select * from $EventsTable where Id='$edit'";
$query=mysql_query($EditQuery)||die(mysql_error());
[/snip]

You forgot the connection string arguement in mysql_query

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php