PHP and mySQL help!

From: Date: Fri, 10 Jan 2003 17:45:28 +0000
Subject: PHP and mySQL help!
Groups: php.db 
Request: Send a blank email to php-db+get-24753@lists.php.net to get a copy of this message
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

« previous php.db (#24753) next »