I tried it with and without quotes and it still doesn't work. :(
Printable View
I tried it with and without quotes and it still doesn't work. :(
Echo out the query and past it here. That will show us any syntax errors.
Dear Jas: I hate to look like even more of a dummy, but how do I "echo out the query?"
I figure it must involve using the echo command but not sure where.... thanks, e
Echo out means you can use either print or echo to send whatever value you've stored in your variable which supposed to hold an SQL statement. For eg:Quote:
I hate to look like even more of a dummy, but how do I "echo out the query?"
PHP Code:$sql = " UPDATE users SET status = 'B', confdate = '" . $today. "', pickdate = '" .$pickdate. "', dropdate = '" .$dropdate. "' WHERE email = '" .$emailaddress."'";
print $sql;
Another problem I found is in your another SQL statement, which is following
Leave the quotes issue for the time being and update it based on the above mentioned demo query. You don't need to enclose numbers within single quotes if they are number based items in your database. In other words the usage of quotes for enclosing the field value purely depends upon the data type that you use in the database. Consider an example a table with two fields one string and one number, for updating a record in such a table would be like the following:PHP Code:$sql = " UPDATE `users`
SET status = 'I', visit = (visit + '1'), visdate = '$today', pickdate = '$pickdate', dropdate = '$dropdate', remind = '0', act = '0', survey = '0'
WHERE email = '$emailaddress' ";
Another problem in your above SQL is the way you increment the field value visit, which will result in error. If you want to insert a value incremented by the existing value then first you have to query the value using another database operation store it in some variable and using that increment it in the SQL statement.PHP Code:$sql = "update mytable set name='codeexploiter', age=33 where name like 'codeexploiter'";
Dear Jas: It's working!!! Thanks a million! I am ecstatic. I spent the entire day yesterday fighting with that one and now I can move on to what I was trying to do with it in the first place. Thank you for lending your eyes and straightening out my quote confusion. I read what Daniel wrote over and over but couldn't quite grasp when to use quotes or not until you showed me examples with my own data. Much appreciation to you, TheTestingSite, and Daniel.
Yahoooooo!!!! e :)