RE: PHP and mySQL help!

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

 



Are you sure $date and $host have a value? Is register globals on or
off? Echo your query to the screen before you execute it to make sure
it's what you think it is. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Dzung Nguyen [mailto:dunguyen@iol.unh.edu]
> Sent: Friday, January 10, 2003 12:45 PM
> To: php-db@lists.php.net
> Subject:  PHP and mySQL help!
> 
> Hi!  I have a PHP page with a few text areas where users can enter
> different combination of fields to query a mySQL database.  An example
> of a query would be like this:
> 
> $query = "SELECT build_ids.build_id, build_ids.username,
build_ids.host,
>                      build_ids.configuration, build_ids.build,
> build_ids.target, build_tests.input,
>                      build_tests.output, build_tests.result,
> build_tests.test_name,
>                      build_tests.prms_id, build_ids.date FROM
build_ids,
> build_tests
>                      WHERE build_ids.date like \"$date%\"  and
> build_ids.host like \"$host\" and
>                      build_ids.build_id like build_tests.build_id";
> 
> The query would work if I use mySQL from command line, w/o using the
> variable, but use the field names themselves.  But wouldn't work when
I
> try to use variable like above and set the variables from a PHP page.
>  Anybody knows what's wrong w/ my code or could show me to some
helpful
> resources?  Please reply to this email as I am not a subscriber of
this
> list.  Thank you very much!  I really appreciate your help!
> 
> --
> Dzung V. Nguyen                     email: dunguyen@iol.unh.edu
> Alpha Linux Group                   http://linux.iol.unh.edu/clp
> InterOperability Laboratory
> University of New Hampshire         phone: (603) - 862 - 0401
> Durham, NH 03824                    fax  : (603) - 862 - 4181
> 
> 
> 
> 
> --
> 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