Re: Stumped with proper query and display

From: Date: Wed, 07 Apr 2004 15:01:46 +0000
Subject: Re: Stumped with proper query and display
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-33781@lists.php.net to get a copy of this message
On Wednesday 07 April 2004 21:18, Mignon Hunter wrote: > I never saw this email come across - I think it got caught in spam software > on 4-1 Check the archives. > ******************************************************** > > Well I'm still working on this off and on - still having problems :| > > I couldnt get the foreach to work properly..I keep getting: > > "Invalid argument supplied for foreach() ". > > I've tried lots of different stuff but here's an example: > > ***************************************************** > > $query = "SELECT * FROM cust"; > $res = mysql_query($query, $ups_conn) or die(mysql_error()); > > $query2 = "SELECT * FROM contact"; > $res2 = mysql_query($query2, $ups_conn) or die(mysql_error()); > > while ($row = mysql_fetch_assoc($res)) { > while ($row2 = mysql_fetch_assoc($res2)) { I've no idea what you're trying to do. Are the tables 'cust' and 'contact' related in any way? What is the relation? And shouldn't the relation be reflected in your queries? And if so your second query should be inside your outer while-loop. -- 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-db ------------------------------------------ /* Now I lay me back to sleep. The speaker's dull; the subject's deep. If he should stop before I wake, Give me a nudge for goodness' sake. -- Anonymous */

« previous php.db (#33781) next »