Frage

This question already has an answer here:

I've got a PHP warning in my web app. I'm a bit of a noob. I want to add a timezone offset to the 'updated' timestamp based on the 'adjusttimezone' integer in each user's profile?

This is the code:

$timezonequery = mysql_query('SELECT adjusttimezone FROM members WHERE member_id=' . $_SESSION["myid"]);
$timezone = (int)mysql_result('$timezonequery', 0);
$updatedquery = mysql_query('SELECT DATE_ADD(updated, INTERVAL ' . $timezone . ' HOUR) FROM projects WHERE project_id=' . $i);

It works, but I'm worried about this warning:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in xxx.php on line 9

Can anyone help? Thanks

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top