Jump to content

MySQL UPDATE for a booleon


russia5

Recommended Posts

Hello, Hope everone is well!  I am coding a confirmation letter.  The signup is a email address only.  I have a database with these parameters:  email md5hash timestamp stutus(booleon)

There are two files (participating in this question): subscribe.php and confirm.php

Subscribe takes the posting from the form (the email) and inserts the email address, a time stamp, the md5 hashmark, and sets a status (booleon) to zero.  It works fine.


A email is then sent to the subscriber, asking the subscrber to hit a link.  It also works.  An example of the email is:

http://www.mysite.com/confirm.php?id=10e28515026ea29f73353a3f716dafa1

Upon hitting the URL, the confirm code is suppose to update the record associated with the md5(and email of course) with a status bit of 1.

It does not work.

Here is the confirm.php code:

[code]

<?php

$id = ($_GET['id']);

include_once ("config.php");

$result = mysql_query('UPDATE db_tbl
SET status = '1'
WHERE id = $id');
if (!$result) {
   die('Invalid query: ' . mysql_error());
}

?>


[/code]

$id = md5
$status = '1' or '0'

$status is suppose to go from 0 to 1.

It does not.

Here is the error.

Parse error: parse error, unexpected T_LNUMBER in /home/russia5/public_html/confirm.php on line 11

Line 11 is SET status = '1'

Thankyou to all that consider the question!

Greg
Link to comment
https://forums.phpfreaks.com/topic/20781-mysql-update-for-a-booleon/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.