时间:2021-07-01 10:21:17 帮助过:17人阅读
";$con = mysql_connect('localhost', 'root', '');if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("test", $con);mysql_query("set names utf8");//$sql = " SELECT * FROM ecm_acategory ";$sql = " insert into data (name) values('999')";echo $sql;$result = mysql_query($sql);mysql_close($con);?>
你
xmlhttp.open("GET","=base_url()?>project_c/add_zijiedian/"+str1+str,true);
然后看看浏览器中的源代码
//插入预算表 $this->db->query("select @myLeft:=PLeft from constrproj where ConstrProjName = '$dangqiandianname' "); $this->db->query("UPDATE constrproj SET PRight = PRight + 2 WHERE PRight > @myLeft"); $this->db->query("UPDATE constrproj SET PLeft = PLeft + 2 WHERE PLeft > @myLeft"); $query3 = $this->db->query("select * from constrproj where ConstrProjID= ( SELECT min(ConstrProjID) from constrproj)"); $arr = $query3->result_array(); $ParentID = $arr[0]['ConstrProjID']; //echo ''; $this->db->query("INSERT INTO constrproj(ConstrProjName,PLeft,PRight,ParentID,KindLvl) VALUES('$zijiediandianname',@myLeft + 1, @myLeft +2,'$ParentID',1)" ); $query2 = $this->db->query("select * from constrproj"); $result_count2 = count($query2->result());
PLeft 不能为空
你向 PLeft 列负的值是 @myLeft + 1
显然 @myLeft 是空值 NULL
那不是乱码,而是 url 编码
入库前先解码(urldecode)
搞定 谢谢!