Jump to content

[SOLVED] dueling tables... on Join


bateman

Recommended Posts

alright, so I'm trying to pull data from 2 tables to create a list. I'm successful in phpmyadmin but it won't pull when I try from php.

 

Here is the code I'm using

 

$query2 = mysql_query("SELECT * FROM photog, shoot WHERE photog.actual=shoot.photog ORDER BY id Asc");

...

...

$x = 1; 
while ($list = mysql_fetch_assoc($query2)) {
$photog = $list['photographer']; $link = $list['actual']; $picid = $list['image'];$shoot = $list['shoot']; $num = $list['num'];
    // echo data 
?> 
<?=$photog;?><br><a href="model/index.php?p=<?=$link;?>&s=<?=$num;?>&i=1" ><?=$shoot;?></a><?
echo ($x)? "<br><br>" : "";
$x++; } // end while    

 

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/174231-solved-dueling-tables-on-join/
Share on other sites

what do you mean by "it won't pull when I try from php"? no rows are returned? are you sure you are connected to the right database? try updating this line:

$query2 = mysql_query("SELECT * FROM photog, shoot WHERE photog.actual=shoot.photog ORDER BY id Asc") or die(mysql_error());

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.