Jump to content

Query array question


182x

Recommended Posts

Hey guys,

 

In order to display data from sql queries in a table I have had to create two different queries and then put the results into different arrays so this can be achieved as when I preform a join query it does not seem to work.

 

I was just wondering can this be achieved with queries which make use of more than one table or are two different arrays the only way to go?

 

thanks.

 

example:

while($s1=mysql_fetch_array($query1))
{

$s2=mysql_fetch_array($query2); 
     echo "<tr class='style4'><td>".$s1['ds']."</td><td>".$s2['hy']."</td></tr>";
}

Link to comment
https://forums.phpfreaks.com/topic/60872-query-array-question/
Share on other sites

I think i got the join working but how is this data displayed in a table for example in the code below i don't think the array elements can be accessed like tableA.ds and tableB.hy

 

while($s1=mysql_fetch_array($query1))
{

$s2=mysql_fetch_array($query2); 
     echo "<tr class='style4'><td>".$s1['ds']."</td><td>".$s2['hy']."</td></tr>";
}

Link to comment
https://forums.phpfreaks.com/topic/60872-query-array-question/#findComment-302867
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.