Re: Multiple Queries

From: Date: Thu, 15 Jan 2004 16:05:48 +0000
Subject: Re: Multiple Queries
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174671@lists.php.net to get a copy of this message
From: "Arthur Pelkey" <apelkey@northeastquality.com> > I have a page that has multiple queries on it, I want to do doing the > following: > > Query a mysql db multiple times in the same page, but i must be missing > something, I keep getting these AFTER the first queryis successful: > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result resource in /path/php_file.php on line line_number > > Can someone point in the right direction on how to do multiple queries, > some are not querying the same db btw. There's no real trick to it. You can have as many mysql_query() calls as you want. You probably just need to check that you're assigning the result of it to a unique variable each time and not overwriting results or rows from previous queries. Post your code if you want, but your error means your query is failing or you're using the wrong variable in one of the mysql_fetch_*() functions. Using mysql_error() will help here. ---John Holmes...

« previous php.general (#174671) next »