First the query;
Code: Select all
$conn_update = mysql_connect($hostname_conn_update, $username_conn_update, $password_conn_update) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database_conn_update, $conn_update); //connection is already open
$query_site_update = htmlspecialchars("UPDATE tbl_member_pagedata SET link_sect1_title={$_POST['top_title']}, link1_name={$_POST['link1_title']}, link1_url={$_POST['url1']}, link1_desc={$_POST['desc1']}, link2_name={$_POST['link2_title']}, link2_url={$_POST['url2']}, link2_desc={$_POST['desc2']}, link3_name={$_POST['link3_title']}, link3_url={$_POST['url3']}, link3_desc={$_POST['desc3']}, link4_name={$_POST['link4_title']}, link4_url={$_POST['url4']}, link4_desc={$_POST['desc4']}, link5_name={$_POST['link5_title']}, link5_url={$_POST['url5']}, link5_desc={$_POST['desc5']}, link_sect2_title={$_POST['bottom_title']}, linkA_name={$_POST['linka_title']}, linkA_url={$_POST['urla']}, linkA_desc={$_POST['desca']}, linkB_name={$_POST['linkb_title']}, linkB_url={$_POST['urlb']}, linkB_desc={$_POST['descb']}, linkC_name={$_POST['linkc_title']}, linkC_url={$_POST['urlc']}, linkC_desc={$_POST['descc']}, linkD_name={$_POST['linkd_title']}, linkD_url={$_POST['urld']}, linkD_desc={$_POST['descd']}, linkE_name={$_POST['linke_title']}, linkE_url={$_POST['urle']}, linkE_desc={$_POST['desce']} WHERE member_number={$_POST['member_id']}");
$result_site_update = mysql_query($query_site_update, $conn_update) or die("Web Site data update failed -- Contact an administrator!! " . mysql_error());
mysql_close($conn_update);The query crashes after the first field is parsed. I get the following error:
Now you are probably seeing garbage characters at the end, but that's just because the data is in UTF-8 Japanese. (The entire site is actually in utf-8.)The first word "Links" is the second half of the first field. The entire field is "My Links". I have no idea why it would not like that. then the comma separator and the second field with its data including the HTML <br>.Web Site data update failed -- Contact an administrator!! 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 'Links, link1_name=ファーマネックス<br>ジャパ
I have tried addslashes(), htmlentities(), htmlspecialchars() to get this to work. All to no avail. No matter what I do, the query craps out in the same place.
Any help greatly appreciated.
Thanks,