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.

  $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,
WHERE videos.email='$email' AND fgusers3.email='$email'

  echo "<table border='1'>
  while ($row = mysql_fetch_array($result)) {
  echo "<tr>";
  echo "<td>" . $row['videoname'] . "</td>";
  echo "</tr>";
  echo "</table>";

4 Years
Discussion Span
Last Post by garyjohnson


bool law.

You mean Boolean?

Boolean valves are True or False.

I don't see any code regarding about True or False?

Here is an example what I am talking about:

These are the valves:

$true = 1;
$false = 0;

$true  = true;
$false = false;

This is the equation:

$true = 1;

if (!$true) {
print("that's true");
else {
print("that's not true");

The answer will print out "that's true"

Here is another equation:

$false = 0;

if ($false == 1) {
print("that's false");
else {
print("that's not false");

The answer will print out "that's not false"

Do you get it now?

Edited by LastMitch: g


Yes I get it now lol, I have fixed my code and it works properly. But I am curious if you know how to get the code on line 25 to be a hyperlink? I want the variable $row['videoname'] to be a link.



I want the variable $row['videoname'] to be a link.

Your old code:

echo "<td>" . $row['videoname'] . "</td>";

Now your new code:

echo "<td><a href='" ."Your Link". $row['videoname'] . "'>File Name</a></td>";

Or another option:

echo "<td><a href='Your Link'>File Name</a></td>";  
This question has already been answered. 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.