Jump to content

Help with the Transact File


cyber_alchemist

Recommended Posts

this is my code ...

  if (!empty($user_id) && !empty($ml_id)) {
        echo 'empty security pass ..' ;
        $query = 'UPDATE ml_subscriptions
            SET
                pending = 0 
            WHERE
                user_id = ' . $user_id . ' AND
                ml_id = ' . $ml_list;

        mysql_query($query, $db);

        $query = 'SELECT
                listname
            FROM
                ml_lists
            WHERE
                ml_id = ' . $ml_id;
        $result = mysql_query($query, $db);

        $row = mysql_fetch_assoc($result);
        $listname = $row['listname'];
        
        mysql_free_result($result);

        $query = 'SELECT 
                first_name, email
            FROM
                ml_users
            WHERE
                user_id = ' . $user_id;
        $result = mysql_query($query, $db);

        $row = mysql_fetch_assoc($result);
        $first_name = $row['first_name'];
        $email = $row['email'];
        mysql_free_result($result);

        $message = 'Hello ' . $first_name . ',' . "\n";
        $message .= 'Thank you for subscribing to the ' . $listname .  ' mailing list.  Welcome!' . "\n\n";
        $message .= 'If you did not subscribe, please accept our ' .
            'apologies.  You can remove' . "\n";
        $message .= 'this subscription immediately by visiting the ' .
            'following URL:' . "\n";
        $message .= 'http://www.massmailer.pixub.com.com/ml_remove.php?user_id=' .
            $user_id . '&ml_id=' . $ml_id;

        $mail = new SimpleMail();
        $mail->setToAddress($email);
        $mail->setFromAddress('[email protected]');
        $mail->setSubject('Mailing list subscription confirmed');
        $mail->setTextBody($message);
        $mail->send();
 
    header('Location: ml_thanks.php?user_id=' . $user_id . '&ml_id=' .
        $ml_id . '&type=s');
    } else {
        header('Location: ml_user.php');
    }

every this is working fine just that the query ...

$query = 'UPDATE ml_subscriptions
            SET
                pending = 0 
            WHERE
                user_id = ' . $user_id . ' AND
                ml_id = ' . $ml_list;

        mysql_query($query, $db);

doesn't seem to update my table , is my query is wrong ??? is my syntax is correct for the updating the table ??

Link to comment
https://forums.phpfreaks.com/topic/283639-help-with-the-transact-file/
Share on other sites

but , 

;

comes after 

''

isn't it ???

 

like 

$query = '<your query >';

 it could be like :

'UPDATE ml_subscriptions
SET
pending = 0
WHERE
user_id = '.$user_id.' AND
ml_id = '.$ml_list. '';

isn't it ?

 

phpcodechecker.com returns this error 

 

PHP Syntax Check: Parse error: syntax error, unexpected T_VARIABLE in your code on line 102

 

$result = mysql_query($query, $db); 

 

after i do what you asked..

yes i can but it didn't solved the problem ???? i mean both things mean the same ?

 

whether i write 

'UPDATE ml_subscriptions
SET
pending = 0
WHERE
user_id = '. $user_id .' AND
ml_id = '. $ml_list;

or

'UPDATE ml_subscriptions
SET
pending = 0
WHERE
user_id = '.$user_id.' AND
ml_id = '.$ml_list. '';

but anyways i got why it wasn't working from the irc channel :)

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.