bamfon Posted January 14, 2011 Share Posted January 14, 2011 <?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 Quote Link to comment https://forums.phpfreaks.com/topic/224397-linking-tables/ Share on other sites More sharing options...
bamfon Posted January 14, 2011 Author Share Posted January 14, 2011 ok i forgot to put in so the erorr is Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\studying\take 2\addin12.php on line 45 Column 'animeid' in where clause is ambiguous Quote Link to comment https://forums.phpfreaks.com/topic/224397-linking-tables/#findComment-1159236 Share on other sites More sharing options...
revraz Posted January 14, 2011 Share Posted January 14, 2011 You need to state which table the field name is from, ie.. animel1.animeid Quote Link to comment https://forums.phpfreaks.com/topic/224397-linking-tables/#findComment-1159239 Share on other sites More sharing options...
bamfon Posted January 14, 2011 Author Share Posted January 14, 2011 its from both tables? so how would i do that? Quote Link to comment https://forums.phpfreaks.com/topic/224397-linking-tables/#findComment-1159242 Share on other sites More sharing options...
bamfon Posted January 14, 2011 Author Share Posted January 14, 2011 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()); Quote Link to comment https://forums.phpfreaks.com/topic/224397-linking-tables/#findComment-1159244 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.