mercredi 20 avril 2016

Why is my php "if statement" not affecting my "my_sql" query?

First of all, I know my_sql is deprecated. Will change to my_sqli as soon as I figure out the issue at hand. My query continues to update all my rows even if the data is not set in the 'stripetoken' column. Why is this happening?

Code snippet:

$token_query = 'SELECT * FROM jobsubmission';
$token_res = mysql_query($token_query);
$token_row = mysql_fetch_array($token_res);


if(isset($token_row['stripetoken'])) {
    $updqry = 'UPDATE jobsubmission SET assigned=1 WHERE ID="'.$book_ids[$jcount].'"';
    $update = mysql_query($updqry);
    $bookdate = date("d-m-Y");

Aucun commentaire:

Enregistrer un commentaire