Hello,
this is the first time i've worked with php and select statements in mysql where i use the LIKE arguement...
well, i have a search.. it searches by date and/or keywords... the date works fine... if i search just by the date, it finds the correct records and displays results.. however when i try to search by keywords either alone or with the date, i run into an error and no results when there should be results... here's the error:
Warning: Supplied argument is not a valid MySQL result resource in C:\WINDOWS\Desktop\pcinov\nlumc\search.php on line 150
line 150 contains this code:
$num = mysql_num_rows($result);
here's the sql query im using:
$sql = "SELECT * FROM bulletins WHERE bulletin LIKE %$keywords% ORDER by date";
now i've tried without the %% signs, which should be irrelevant anyways...
the keywords variable isn't empty...
thanks for the help.. oh and while im on the topic.. in mysql... i have a normal varchar field for my date, because i don't like the format mysql date field uses... (i like the good ol 01/01/01 style)... when i say like order sql statements by date, even though it is not formatted as a date field, will it still compare and order how it should?
thanks for the help!