I hate to look like even more of a dummy, but how do I "echo out the query?"
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:
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
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' ";
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 mytable set name='codeexploiter', age=33 where name like 'codeexploiter'";
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.
Bookmarks