I have a function that's supposed to query mysql with a zip code, and generate an html <select> box with possible cities. Instead, it crashes the site and gives this error:
Code:
Fatal error: Can't use function return value in write context in /home/rahl/public_html/RVM/include/functions.php on line 298
# errorno=1064
# error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
# query=query
I think this is causing the problem:
PHP Code:
if(empty($error))
{
$query = mysql_query("UPDATE Users SET title='$title',last_name='$l_name',first_name='$f_name',zip='$zip' WHERE handle='$user_name'")
or die(mysql_error());
I've Failed You:
# Script Name: /RVM/registration/register2.php
# Include File: /home/rahl/public_html/RVM/include/functions.php
# errorno=1064
# error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
# query= 1
I've Failed You:
# Script Name: /RVM/registration/register2.php
# Include File: /home/rahl/public_html/RVM/include/functions.php
# errorno=1064
# error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
# query= 1array(2) { [0]=> array(4) { ["file"]=> string(48) "/home/rahl/public_html/RVM/include/functions.php" ["line"]=> int(217) ["function"]=> string(10) "safe_query" ["args"]=> array(1) { [0]=> &bool(true) } } [1]=> array(4) { ["file"]=> string(53) "/home/rahl/public_html/RVM/registration/register2.php" ["line"]=> int(29) ["function"]=> string(20) "form_validator_names" ["args"]=> array(4) { [0]=> &string(3) "Dr." [1]=> &string(4) "last" [2]=> &string(4) "nick" [3]=> &string(5) "23456" } } }
I've Failed You:
# Script Name: /RVM/registration/register2.php
# Include File: /home/rahl/public_html/RVM/include/functions.php
# errorno=1064
# error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
# query= 1
Bookmarks