RE: [PHP-DB] PHP and mySQL help!

From: Date: Fri, 10 Jan 2003 18:11:26 +0000
Subject: RE: [PHP-DB] PHP and mySQL help!
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24755@lists.php.net to get a copy of this message
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-DB] 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 Ó, ô > 'ž!=.Æ1É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

« previous php.db (#24755) next »