Hi
I'm having problems with this line of code, and was wondering (after 6 hours pulling my hair out) if I'm just beeing a noobly nob!
$result=mysql_query("select * from ".$mysql_table_prefix."test WHERE indexdate = '$dateentered' ORDER BY site_id DESC");
index date is stored like 2005-08-04
there are about 12 in the table with this date.
I've made a form that you enter the date to list the results, the form passes the var as bydate which I then convert in the script the form goes to like this...
if ($bydate == 0) {
die("No Date was entered");
} else {
$dateentered = $bydate;
print "<h3>$dateentered Testing</h3>";
index_alldate();
print "<h1>$bydate - $url</h1>";
die("It got to here!");
}
So I convert $bydate to $dateentered, they both return the same result, the result is what i typed in the text box on the form.
However, the function index_alldate(); needs the value of $dateentered put in the WHERE clause so only the results with the value I entered are returned.
For some reason it does not work, however if I change the code to ...
$result=mysql_query("select * from ".$mysql_table_prefix."test WHERE indexdate = '2005-08-04' ORDER BY site_id DESC");
It works !...
What i need it to do, is grab the data from the table from the date I enter in the form!
Anyone? Help!!!!! 🙁 😕