4images Forum & Community
General / Allgemeines => Programming => Topic started by: sameerG on April 25, 2009, 09:39:13 AM
-
$sql = "UPDATE ".USERS_TABLE."
SET user_name='$user_name',user_country='".$user_info['user_country']."',user_state='".$user_info['user_state']."',user_address='".$user_info['user_address']."',user_phone='".$user_info['user_phone']."',user_fax='".$user_info['user_fax']."',user_web='".$user_info['user_web']."',user_mod_height='".$user_info['user_mod_height']."',user_mod_weight='".$user_info['user_mod_weight']."',user_mod_waist='".$user_info['user_mod_waist']."',user_mod_hips='".$user_info['user_mod_hips']."',user_mod_chest='".$user_info['user_mod_chest']."',user_fashion_is='".$user_info['user_fashion_is']."',user_fashion_in='".$user_info['user_fashion_in']."',user_workexp='".$user_info['user_workexp']."',user_achiv='".$user_info['user_achiv']."',user_goal='".$user_info['user_goal']."'
where user_id=".$user_info['user_id'];
$result=$site_db->query($sql);
I have also tried following qury to,
SET ".get_user_table_field("", "user_name")." = '$user_name'
but it cant work,
it replaces null in place of variables name. So please help me I completely new to using PHP and also 4images too.
Thanks in advance
-
The query looks fine, I think, perhaps it's the rest of the code that is wrong?
-
$sql = "UPDATE ".USERS_TABLE."
SET user_name='$user_name',
Are you shure there are no qutation marks missing? Like SET user_name='".$user_name."',
Edit: Ups, sorry they are not missing. My bad.
Have a look at your query with echo $sql;
.
What does mysql say? For debugging purposes put a
if (!$result) {
echo "Database error:".$site_db->error."<br />";
}
after the query.