I am trying to join two database tables, the tables are set up like this,
This is table fgusers3, which stores my users login information.
id_user name email phone_number username password confirmcode
1 Bob bob@email 000000 bob1 bobby 12345
This is table videos, which stores my users video upload information.
videoname email filename
Funny bob@email funny.mp4
Now this is the code which joins them together and is suppose to display the results on the page but I keep getting an error about the bool law.
<?php
session_start();
$email=$_SESSION['email_of_user'];
$con = mysql_connect("localhost","root","root");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("radhalfs", $con);
$result = mysql_query("
SELECT videos.videoname
FROM videos,
fgusers3
WHERE videos.email='$email' AND fgusers3.email='$email'
");
echo "<table border='1'>
<tr>
<th>Name</th>
<th>Message</th>
</tr>";
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['videoname'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>