$sql="insert into test1(num1,name,sex,age,telephone,hospital,id,arear,bed,sample,num,doctor,data,dis,subobject,result) values('$str','$name','$sex','$age','$telephone','$hospital','$id','$area','$bed','$sample','$num','$doctor','$data','$dig','$object','$result')";$result=mysql_query($sql);if(!$result){echo "插入失败";}elseecho "插入成功";当代码是上面的执行就成功但是当代码变成下面的就不能执行了,只是多加了一个$add,print"$add";这句这行成功$sql="insert into test1(num1,name,sex,age,telephone,hospital,id,arear,bed,sample,num,doctor,data,dis,subobject,result,add) values('$str','$name','$sex','$age','$telephone','$hospital','$id','$area','$bed','$sample','$num','$doctor','$data','$dig','$object','$result','$add')";$result=mysql_query($sql);if(!$result){echo "插入失败";}elseecho "插入成功";而且在mysql中执行insert into test1(num1,name,sex,age,telephone,hospital,id,arear,bed,sample,num,doctor,data,dis,subobject,result) values('$str','$name','$sex','$age','$telephone','$hospital','$id','$area','$bed','$sample','$num','$doctor','$data','$dig','$object','$result');是正确的,可以插入但是执行insert into test1(num1,name,sex,age,telephone,hospital,id,arear,bed,sample,num,doctor,data,dis,subobject,result,add) values('$str','$name','$sex','$age','$telephone','$hospital','$id','$area','$bed','$sample','$num','$doctor','$data','$dig','$object','$result','$add');错误,不能执行。table名:test1表头包括:num1,name,sex,age,telephone,hospital,id,arear,bed,sample,num,doctor,data,dis,subobject,result,add执行mysql语句时values中已经换成对应的内容了。
添加回答
举报
0/150
提交
取消