imarockstar Posted May 1, 2009 Share Posted May 1, 2009 I am gettng an error with this query ... $sql="SELECT tourdates.id AS tdid, bands.id AS bandid, * FROM tourdates INNER JOIN bands ON tourdates.bandid = bands.id WHERE tourdates.id = '$id' && tourdates.userid = ". error : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tourzag/public_html/display_tourdate.php on line 41 more code : <?php $user = $_SESSION['id']; $id = $_GET['id']; $bandid = $_GET['bandid']; // Retrieve data from database $sql="SELECT tourdates.id AS tdid, bands.id AS bandid, * FROM tourdates INNER JOIN bands ON tourdates.bandid = bands.id WHERE tourdates.id = '$id' && tourdates.userid = ". $_SESSION['id']; $result=mysql_query($sql); // Start looping rows in mysql database. $rows = mysql_fetch_array($result); // this is line #41 ?> Link to comment https://forums.phpfreaks.com/topic/156448-solved-mysql-help/ Share on other sites More sharing options...
Ken2k7 Posted May 1, 2009 Share Posted May 1, 2009 $result=mysql_query($sql) or die(mysql_error()); Can you put that up and see what error you get back? But I wonder if your alias of bandid can be causing the problem. Either case, this isn't in the right forum. Link to comment https://forums.phpfreaks.com/topic/156448-solved-mysql-help/#findComment-823758 Share on other sites More sharing options...
imarockstar Posted May 1, 2009 Author Share Posted May 1, 2009 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM tourdates INNER JOIN bands ON tourdates.bandid = bands.id WHERE tourdates' at line 1 Link to comment https://forums.phpfreaks.com/topic/156448-solved-mysql-help/#findComment-823761 Share on other sites More sharing options...
Ken2k7 Posted May 1, 2009 Share Posted May 1, 2009 This is solved? Link to comment https://forums.phpfreaks.com/topic/156448-solved-mysql-help/#findComment-823774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.