Jump to content

linking tables


bamfon

Recommended Posts

<?php 

$con = database_connect();
$sql = "SELECT *
FROM anime1, episode1
WHERE animeid='$animeid'";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$title = $row['title'];
$ep = $row['ep'];
}


?>

 

keep giving me back error

 

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\studying\take 2\addin12.php on line 45

Link to comment
https://forums.phpfreaks.com/topic/224397-linking-tables/
Share on other sites

Fixed it changed it to <?php

 

$con = database_connect();

$sql = "SELECT * FROM anime1, episode1 WHERE anime1.animeid = '$animeid' AND episode1.animeid = '$animeid' ";

$result = mysql_query($sql);

while ($row = mysql_fetch_assoc($result)) {

$title = $row['title'];

$ep = $row['ep'];

 

}mysql_query($sql) or exit(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/224397-linking-tables/#findComment-1159244
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.