getting day from mysql date

A

Anonymous

Guest
Hey guys,

I got a little problem. I got a mysql table which holds a bunch of entries with different dates, e.a. 2005-04-17

Now I want to do a query that only selects all entries which were made on specific day, Saturday for example. I have no clue how to do that, I've read thru a bunch of stuff already but couldn't really find a good answer.

Maybe somebody can help me out, I'd be really thankful for a quick answer.


-Eddie
 
alright, figured this out:

Code:
$query = "SELECT * FROM cust_order WHERE DAYNAME(late_return_date)='Friday'";
$result = mysql_query($query);
$lines = mysql_num_rows($result);

When I do that, I get this error message tho:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in statistics.php on line 102

I am getting a result whenever I enter that query directly in mysql. Can anybody help me with that?
 
problem solved, I had the wrong database selected ...

thanks anyways.


-Eddie
 
Back
Top