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
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());

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.