Jump to content

[SOLVED] mysql help ..


imarockstar

Recommended Posts

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

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.