Forum Moderators: coopster

Message Too Old, No Replies

search query help

         

lileen

8:54 am on Jan 16, 2006 (gmt 0)



hello.. can somebody help me on this?

im doing a search query, whereby it'll have to satisfy a few conditions. as it's very straightforward it'll need to pass conditions from 4 fields before returning the result. i've made use of a temporary table. thing is, i could return it using one condition, but it gives a msg saying query unbuffered when i tried with all 4.

$result = mysql_query("SELECT * FROM PEAR_reports WHERE trainer='$trainer1' AND program_title='$program_title1' AND start_date='$start_date1' AND end_date='$end_date1'");

anything wrong or funny with that line?

tomda

8:59 am on Jan 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, nothing wrong with that line...
Make sure that date are in valid format!

Do this to show your query and help you to debug it:

$sql = "SELECT * FROM PEAR_reports WHERE trainer='$trainer1' AND program_title='$program_title1' AND start_date='$start_date1' AND end_date='$end_date1'";
echo $sql;
$result = mysql_query($sql);

coopster

3:27 pm on Jan 16, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, lileen.

I agree with tomda, all looks fine. The *unbuffered* error is a bit different though, sounds like it may be a configuration issue. You could also incorporate mysql_error() [php.net] to further troubleshoot your issue (also see the mysql_errno() and other relative troubleshooting links on this page).