which part is not working? Put a "or die(mysql_error())" behind your
queries to see which one produces an error.

like this:  $result = mysql_query("SELECT * FROM ships ORDER BY ship",$db)
or die(mysql_error());
> while ($row = mysql_fetch_array($result)) {
>     If ($result) {
>         $id = $row["id"];

you should put this the other way round that is the if before the while.
If($result) will always be "true"
within the while-loop.

> While ($result) {

you don't need another while here. Leave it out.

>              $result2 = mysql_query("SELECT * FROM convicts WHERE
> convicts.ship = $id ORDER BY convict",$db);

put '' around the $id thus: WHERE convicts.ship='$id'...; // you don't
neccesarily need the
convicts before your columns name. There is no possible ambuguity.

> $row2 = mysql_fetch_array($result2)
>              $id = $row2["id"];
> $convict = $row2["convict"];
> $ref = $row2["ref"];
> $contact = $row2["contact"];

In your original code you don'T do anything with $id, $ref or $contact. I
that is just left out ;-)

Keep on asking.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to