我不知道是什么错了,我的数据怎么也更新不到数据库里。下边是语句。请各位帮帮忙? 你的sql语句好像有问题耶,可以这样写吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $dbh= mysql_connect('localhost','zhaoren','zhaoren');mysql_select_db('love_me');$str_sql = "select * from record where id='$user_id'";$dangan_res = mysql_query($dangan_sql,$dbh);$dangan_data = mysql_fetch_array($dangan_res);//改if ($dangan_data)为if($dangan_res)//试试{$strUP = "update record set ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) where id='$user_id'";}else{$strUP = "insert into record ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) values('&user_id',)}"; SQL语句也有毛病。看看update和insert的用法吧。 UPDATE tbl_name SET col_name1=expr1,col_name2=expr2,...[WHERE where_definition] [LIMIT #]INSERT INTO tbl_name[(col_name,...)] VALUES (expression,...),(...),... 为什么左侧的导航栏和右边的内容不能同时出现呢? 关于判断的问题 急急急 关于版本号的下载问题 怎样格式化一段代码... 各位大虾请给点提示...... 根据来访ip跳转到来访者所在国家母语的子站点。 请教php保存数据的方案,谢谢! php 如何得到一个 domain 的 dns 主机的 ip ? 使用fsockopen 忽略响应出现问题 这样找代码的思路对吗? 各位php高手,我准备用Linux和PHP建一个网站,请问PHP自己是否有MS的COM或JavaBeans之类的建立逻辑层技术?如果没有,可否有免费的第三方? 怎样在apache服务器中添加虚拟目录并设置可浏览目录属性
mysql_select_db('love_me');
$str_sql = "select * from record where id='$user_id'";
$dangan_res = mysql_query($dangan_sql,$dbh);
$dangan_data = mysql_fetch_array($dangan_res);
//改if ($dangan_data)为
if($dangan_res)//试试{
$strUP = "update record set ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) where id='$user_id'";
}
else
{
$strUP = "insert into record ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) values('&user_id',)
}";
INSERT INTO tbl_name[(col_name,...)] VALUES (expression,...),(...),...