
yusuke
User
Aug 29, 2010, 7:18 PM
Post #1 of 4
(2511 views)
Shortcut
|
|
Website Membership (?) MySQL Error
|
Can't Post
|
|
Hi, I set up multiple member profile pages so members can update their profiles by categories such as login info, store info... I get an error message. (It's in Japanese)
MySQL エラー: 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 'set = 'テスト', message = 'テスト', ' at line 10 TRANSLATION:
MySQL 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 'set = 'TEST', message = 'TEST', ' at line 10
<?php require_once"/home/keepstock-s/www/hairsalon/lib/viewer_functions.php"; ?> <?php if (!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN']) { die("メンバーページが起動していません。"); } ?> <?php if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?> <?php // prepopulate form with current user values foreach ($CURRENT_USER as $name => $value) { if (array_key_exists($name, $_REQUEST)) { continue; } $_REQUEST[$name] = $value; } // process form if (@$_REQUEST['save']) { // error checking $errorsAndAlerts = ""; if (!@$_REQUEST['shopname']) { $errorsAndAlerts .= "ショップ名を入力して下さい。<br/>\n"; } if (!@$_REQUEST['address']) { $errorsAndAlerts .= "住所を入力して下さい。<br/>\n"; } if (!@$_REQUEST['phone']) { $errorsAndAlerts .= "電話番号を入力して下さい。<br/>\n"; } if (!@$_REQUEST['time']) { $errorsAndAlerts .= "営業時間を入力して下さい。<br/>\n"; } if (!@$_REQUEST['station']) { $errorsAndAlerts .= "最寄り駅を入力して下さい。<br/>\n"; } if (!@$_REQUEST['dayoff']) { $errorsAndAlerts .= "休日を入力して下さい。<br/>\n"; } if (!@$_REQUEST['card']) { $errorsAndAlerts .= "カード名を入力して下さい。<br/>\n"; } if (!@$_REQUEST['staff']) { $errorsAndAlerts .= "スタッフ人数を入力して下さい。<br/>\n"; } if (!@$_REQUEST['set']) { $errorsAndAlerts .= "セット面を入力して下さい。<br/>\n"; } if (!@$_REQUEST['message']) { $errorsAndAlerts .= "メッセージを入力して下さい。<br/>\n"; } // update user if (!$errorsAndAlerts) { mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later) if (@$_REQUEST['newPassword2']) { $CURRENT_USER['password'] = $_REQUEST['newPassword2']; } // update password $query = "UPDATE `{$TABLE_PREFIX}accounts` SET shopname = '".mysql_escape( $_REQUEST['shopname'] )."', address = '".mysql_escape( $_REQUEST['address'] )."', phone = '".mysql_escape( $_REQUEST['phone'] )."', time = '".mysql_escape( $_REQUEST['time'] )."', station = '".mysql_escape( $_REQUEST['station'] )."', dayoff = '".mysql_escape( $_REQUEST['dayoff'] )."', card = '".mysql_escape( $CURRENT_USER['card'] )."', staff = '".mysql_escape( $_REQUEST['staff'] )."', set = '".mysql_escape( $_REQUEST['set'] )."', message = '".mysql_escape( $_REQUEST['message'] )."', updatedByUserNum = '".mysql_escape( $CURRENT_USER['num'] )."', updatedDate = NOW() WHERE num = '".mysql_escape( $CURRENT_USER['num'] )."'"; mysql_query($query) or die("MySQL エラー:<br/>\n". htmlspecialchars(mysql_error()) . "\n"); $userNum = mysql_insert_id(); // on success unset($_REQUEST['oldPassword'], $_REQUEST['newPassword1'], $_REQUEST['newPassword2']); // clear password fields $errorsAndAlerts = "メンバー情報は更新されました。"; } } ?> Will you please help me on this problem?
|