0

Hi can someone shed some light on this problem I'm having please?

2 tables

SHOWS_ARCHIVE (TABLE 1)

ID
SHOW_ID
AUTHOR

SHOWS (TABLE 2)

ID

When the member logs in they are a loud to see their shows because of the $author permissions;

if ($_SESSION['MEMBER_PERM'] == "2")
					{
$author = $_SESSION['MEMBER_ID'];

$sql = mysql_query("SELECT * FROM show_archive WHERE author = $author");
					}

but I want to do is see the results using the SHOWS table ID as well. ie

if ($_SESSION['MEMBER_PERM'] == "2")
					{
$author = $_SESSION['MEMBER_ID'];

$sql = mysql_query("SELECT * FROM show_archive WHERE author = $author AND show_id = `shows` id");
					}
2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by stevehart808
0

Hi,
Try the following:

if ($_SESSION['MEMBER_PERM'] == "2")
  {
     $author = $_SESSION['MEMBER_ID'];

$sql = mysql_query("SELECT *, * FROM show_archive, shows WHERE author = $author AND show_id = `shows` id");
					}

That should help you retrieve data from 2 tables at the same time. Let us know how it works.

0

Found the solution!

SELECT * FROM show_archive, shows WHERE show_archive.show_id = shows.id
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.