1) What's the error?
2) Does your sql statement work in mysql (interactive mode)?
3) What does "WHERE 1 AND ..." mean? IOW, what's the '1 AND' supposed to
be doing?
4) Start smaller when you are developing SQL statements that you feel are
complex:
- select * from memodata where readdate = sent;
- select * from memodata where to=1 and readdate = sent;
- select * from memodata where to=1 and readdate = sent order by
id asc;
Whent the last one works properly, paste it into your script.
Dave
On Oct 26, dan scribed:
> Hi,
>
> I've got a database that stores small messages for a service, what I want to
> be able to do is get all rows from the database where the columns "sent" and
> "readdate" match, I have this, but it's erroring. Any pointers please?
>
> SELECT * FROM memodata WHERE 1 AND to=1 AND readdate=sent ORDER BY id ASC
>
> Many thanks,
>
> Dan
>
> P.S: Using MySQL, DBD::mysql, not sure if you need to know that, but saying
> anyway ;)
>
>