Ok, I have two tables and when I try a join I get Resource #9 displayed or the output displays the word Array.
I'm working on a RSVP for my site, people log in and enter data, they get a user_ID automatically. So I created another table RSVP and when a user is logged in the they enter a certain page the RSVP info is displayed. Any help in the code would be great, thank you.
RSVP Table looks like this
rsvp_ID (Auto increment)
regid_ID (secondary key)
Adults (how many adults will come)
Childrent (how many kids will come)
Here is the join I use.
<?php
if(isset($_SESSION['user_id'])) {
$id=$_SESSION['user_id'];
$query = "SELECT * FROM reg_users, rsvp WHERE reg_users.reg_ID = rsvp.regid_ID";
$result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error());
//$result=mysql_query($query) or die(mysql_error());
echo "$result";
//$result = mysql_fetch_array($result);
$result = mysql_fetch_array($result);
echo "$result";
} else {
echo 'You need to be registered and logged into the system before you can make any changes.';
}
?>
<h1>RSVP Stuff</h1>
<fieldset>
<HR>
<p><b>UserID:</b> <?php echo "$id"; ?></p>
<p><b>Date Registered:</b> <?php echo "$registered"; ?></p>
<p><b>Last Logon:</b> <?php echo "$lastlogon"; ?></p>
<p><b>Result:</b> <?php echo "$result"; ?></p>
</fieldset>
Here is what is displayed in my output.
Resource id #9Array // Here are two test displays
RSVP Stuff
--------------------------------------------------------------------------------
UserID: 12 // Here is the userID so I know i am getting that part
Result: Array // Here is where the word Array is displayed instead of any data.