mysql insert两条_当执行mysql insert 时插入两条是怎么回事?

本帖最后由 Eason_____________ 于 2013-07-25 11:25:44 编辑

MySQL 数据库 //做了一个手机上传图片到服务器的功能。但是获取到执行insert语句时都要执行两次!

//index.php

doWork();$i->imageCheck();$sql="insert into json_bbs values('','".$gettitle."','".$getcontent."','".$i->iamgePath."','".time()."','')";mysql_query($sql);?>

//uploadImage.php

imageStauts = 'Error! Wrong HTTP method!';}if(is_array($file) && count($file)>0 && !empty($destination)){$this->fileArray = $file;$this->destination_folder = $destination;$this->imageName = $name;$this->imagePathTemp = $dbPath;$this->updateImage = $update;}else{$this->imageStauts = '初始化失败';}}/** * 开始图片上传*/function imageStart(){if($this->imageStauts === 1){$this->imageCheck();}if($this->imageStauts === 1){$this->doWork();}}/*** * 图片的检查工作*/function imageCheck(){$file = $this->fileArray;//print_r($file);if(!is_uploaded_file($file['tmp_name']) && $this->imageStauts === 1){$this->imageStauts = '图片不存在!'; }if(uploadImage::max_file_size < $file['size'] && $this->imageStauts === 1){$this->imageStauts = '文件太大';} /*//检查mime-typeif(!in_array(strtolower($file['type']), $this->uptypes) && $this->imageStauts === 1){$this->imageStauts = '不支持 '.$file['type'].' 类型的文件';} *///防止在图片元数据的Comment字段中加入了php代码//通过二

你可能感兴趣的:(mysql,insert两条)