Re: echo diferent coluns from left join

From: Date: Thu, 10 Jan 2002 18:28:55 +0000
Subject: Re: echo diferent coluns from left join
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80059@lists.php.net to get a copy of this message
Two ways actually ... You could execute two separate SQL statements, and process them one after another. or You could process your result set, echo()'ing or print()'ing the first elements of the result set, then go back to the beginning and do the second set, something like this ... for ($i = 1; $i <= 2; $i++) { while( $row = mysql_fetch_array($result) )
      {
         echo $row[ $i  ] . " <br>";
      }
mysql_data_seek( $result, 0 ); } Better double check the index of the $row array as I may be returning the field name here, maybe it should be $row[ $i+1], but I think you get the idea. Miles Thompson At 04:08 PM 1/10/2002 -0200, Rodrigo Peres wrote:
Sorry, Ithink that I not explain right. I nedd to create a list, something like: url site <br> url site <br> url_2 site_2 <br> url_2 site_2 <br> When the values returned by url and site finished them proceed to url_2 and site_2 values. Thank's Rodrigo on 1/10/02 3:16 PM, Miles Thompson at milesthompson@ns.sympatico.ca wrote: If I understand you correctly, use Javascript to open a second browser window for url_2. Miles Thompson At 02:49 PM 1/10/2002 -0200, Rodrigo Peres wrote:
Dear List, I have this sql command that grabs a result of 3 tables. What i want is if there's a way to do a while printing the site and url and after it's
finish
begin, printing site_2 and url_2. SELECT celebridades.*, links_relacionados.Nome_Link as site,links_relacionados.Url_link as url, fanclubes.Nome as site_2,fanclubes.Site as url_2 FROM celebridades LEFT JOIN links_relacionados ON links_relacionados.CelebID=celebridades.CelebID LEFT JOIN fanclubes ON fanclubes.CelebID=celebridades.CelebID WHERE
celebridades.CelebID='$celebID'
Thank's in advance Rodrigo Peres -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--


« previous php.general (#80059) next »