Re: mysql_fetch_array() question

From: Date: Mon, 04 Nov 2002 23:49:14 +0000
Subject: Re: mysql_fetch_array() question
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-22981@lists.php.net to get a copy of this message
Hi everyone, I think I've got the problem sorted, I'll soon let y'all know if it doesn't work ! Cheers, Graeme :) On Mon, 2002-11-04 at 21:47, Graeme McLaren wrote: > Hi, Anyone know how I can use two mysql_fetch_array() functions similar > to the code below? I've tried a few different ways but I keep getting > Resource ID #4. I need to do this to retrieve an email address from one > table and retrieve details from another. > > Cheers for any tips - I'm stumped with this one, > > Graeme :) > > $query = "SELECT Name, Address FROM users"; > $query2 = "SELECT EmailAddress From Members"; > > $result = mysql_query($query); > $result2 = mysql_query($query2); > > while($details = mysql_fetch_array($result) and $Email = > mysql_fetch_array($result2)) > { > echo "Name: $details[Name]"; > echo "Address: $details[Address]"; > echo "Email: $Email[EmailAddress]"; > } > > > >

« previous php.db (#22981) next »