Jump to content

Undefined variable


mrt003003

Recommended Posts

Hi there im left joining 3 tables and outputting the results..

 

Nothing is being out;putputted and Im getting an error:

Notice: Undefined variable: row_Test in C:\wamp\www\SWB\ship.php on line 136

Call Stack

# Time Memory Function Location

1 0.0014 408608 {main}( ) ..\ship.php:0

 

Ive tested the join in mysql and it works fine. Its just that on my webpage Nothing is outputted and only this one notice error appears.

 

heres my join:

 

<?php $colname_Test = "-1";
if (isset($_GET['recordID'])) {
  $colname_Test = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_swb, $swb);
$query_Test = sprintf("SELECT s.ShipID, s.FleetName, f.FleetName, f.PlanetName, p.PlanetName, p.PlayerName FROM Ships s

LEFT JOIN Fleet f ON (s.FleetName = f.FleetName)
LEFT JOIN Planet p ON (f.PlanetName = p.PlanetName)
WHERE s.ShipID = '$colname_Ship'");
$Test = mysql_query($query_Test, $swb) or die(mysql_error());
$totalRows_Test = mysql_num_rows($Test); ?>


echo $row_Test['PlanetName']; ?>

 

Heres how my tables connect: ShipID (FleetName) ---> FleetName (PlanetName) ---> PlanetName, so im trying to detemine the fleet and planet the ship is on.

 

Any ideas why its not working??

 

Thanks

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.