display results from a query by most recent date
Posted: Wed Dec 04, 2002 4:25 pm
Question 1.
I have a table with multiple records in it. Each record has it's own timestamp. How do I select the most recent update based on the most recent timestamp?
Question 2.
Some of my users keep putting " ' " in there record updates. I have a form written in php that allows them to view and update certain info. For instance...they update a projects name with the following:
"George's project".
Since that is the projects name, I use that info on another form (passed through a link) to query for information. Problem is when I query the following:
"select description from projects where project.name='George's project';"
it tells me that my query produced no results. If I try to stripslashes(project.name) <---- php function or addslashes(project.name) it still doesn't work. But, if I use:
"select * from projects"
I can see that the projects name actually is "George\''s project". Why then can't I select the description (or any other info) for that project by matching the project's name?
I have a table with multiple records in it. Each record has it's own timestamp. How do I select the most recent update based on the most recent timestamp?
Question 2.
Some of my users keep putting " ' " in there record updates. I have a form written in php that allows them to view and update certain info. For instance...they update a projects name with the following:
"George's project".
Since that is the projects name, I use that info on another form (passed through a link) to query for information. Problem is when I query the following:
"select description from projects where project.name='George's project';"
it tells me that my query produced no results. If I try to stripslashes(project.name) <---- php function or addslashes(project.name) it still doesn't work. But, if I use:
"select * from projects"
I can see that the projects name actually is "George\''s project". Why then can't I select the description (or any other info) for that project by matching the project's name?