Re: Bizzare error

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Bizzare error
Groups: php.general 
Request: Send a blank email to php-general+get-144825@lists.php.net to get a copy of this message
Are you getting a valid result set? Perhaps it is invalid forcing the number of rows to be zero. Try this: $result = mysql_query($query) or die("Query Failed...$query"); And see if it gets past that. Perhaps there are some connection issues as well. So, check for erros when setting up your connection as well. HTH -Brad > Hi, > > I am completely foxed by this: > > $query = "SELECT A.*, B.*, U.User_ID > FROM WMS_Allocations A, WMS_Bookings B, WMS_User U, > WMS_Projects P > WHERE A.User_ID = B.User_ID > AND A.User_ID = '".$ses_user_id."' > AND B.Booking_Start_Date >= '".$_GET[booking_date]."' > AND B.Booking_End_Date <= '".$booking_end_date."'"; > echo "query = $query<br>"; > $result = mysql_query($query); > $num = mysql_num_rows($result); > echo "num = $num<br>"; > if($num != 0){ > //..... > > $num is zero, but it shouldn't be and when i cut and paste the query > directly into mysql i get loads of rows, i would be very grateful if someone > could point out what i have done wrong here. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#144825) next »