jonw118
01-30-2006, 06:24 PM
Hello,
I am modifying a script- but get an error in writing to the database.
Here is where it comes from:
function udf_add_link($form_data,$photo_name,&$error,&$msg){
$sql="insert into links2 values
(null,
'{$form_data['name']}',
'{$form_data['site_url']}',
'{$form_data['description']}',
'$photo_name',
'{$form_data['position']}',
'{$form_data['year']}',
'{$form_data['major']}',
'{$form_data['class']}',
'{$form_data['hometown']})";
I know (or think) it has something to do with the last line:
'{$form_data['hometown']})";
The error I get is this:
Error: database 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 ''Charlotte)' at line 11
in insert into links2 values (null, Name, 'email', '', 'W017_gant.jpg', 'President', 'Junior', 'Business Marketing and Economics', 'Sigma', 'Charlotte)
Can someone tell me how that should be?
Thanks!
I am modifying a script- but get an error in writing to the database.
Here is where it comes from:
function udf_add_link($form_data,$photo_name,&$error,&$msg){
$sql="insert into links2 values
(null,
'{$form_data['name']}',
'{$form_data['site_url']}',
'{$form_data['description']}',
'$photo_name',
'{$form_data['position']}',
'{$form_data['year']}',
'{$form_data['major']}',
'{$form_data['class']}',
'{$form_data['hometown']})";
I know (or think) it has something to do with the last line:
'{$form_data['hometown']})";
The error I get is this:
Error: database 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 ''Charlotte)' at line 11
in insert into links2 values (null, Name, 'email', '', 'W017_gant.jpg', 'President', 'Junior', 'Business Marketing and Economics', 'Sigma', 'Charlotte)
Can someone tell me how that should be?
Thanks!