Re: Bizzare Error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What Doug was trying to say was, "without seeing the sample output, how can
we help you determin the problem with your SQL. Will you please post the
sample 'query=' output so we can better assist you".
 
-------Original Message-------
 
From: shaun
Date: Tuesday, April 22, 2003 09:50:46 AM
To: php-db@lists.php.net
Subject: Re:  Bizzare Error
 
$booking_end_date is correct,

when i say i cut and paste the query i maen i cut and paste the output of
$query so the PHP variables have been parsed...


"Doug Thompson" <dthompson@brickbarn.com> wrote in message
200304221638.h3MGc7G9026669@brickbarn.com">news:200304221638.h3MGc7G9026669@brickbarn.com...
> Is
> AND B.Booking_End_Date <= '".$booking_end_date."'";
>
> maybe supposed to be
> AND B.Booking_End_Date <= '".$_GET[booking_end_date]."'";
>
> Also, because mysql cannot convert the PHP variables, you have to be doing
more than cutting and pasting the query into the CLI. My crystal ball just
went cloudy.
>
> Doug
>
> On Tue, 22 Apr 2003 17:18:45 +0100, shaun wrote:
>
> >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) or die ('Query failed, MySQL says:
> > '.mysql_error().' in '.__FILE__.' line '.__LINE__)
> > $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 also get no error messages.
> >I would be very grateful if someone could point out what i have
> >done wrong here.
> >
> >P.S. This message has been posted in PHP general but i was asked
> >to post it here so please don't attack me for cross posting!
> >
> >
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

. 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux