php - Image is being save to the folder in db but other information is not being save -
need above code saving image folder(photos) define in above code. other data being post form not being save database...i new php , found code website www.jeasyui.com. try modified fail..as usual.:(
if (!isset($_files['image']['tmp_name'])) { echo ""; }else{ $file=$_files['image']['tmp_name']; $image= addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name= addslashes($_files['image']['name']); move_uploaded_file($_files["image"]["tmp_name"],"photos/" . $_files["image"]["name"]); $location="photos/" . $_files["image"]["name"]; $name = $_request['prname']; $code = $_request['prcode']; $type = $_request['prtype']; $weight = $_request['prweight']; $desc = $_request['prdesc']; $machine = $_request['prmachinemodel']; include 'conn.php'; $sql = "insert canon (product_name,product_code,product_type, product_descp, product_weight, machine_model, location) values('$name','$code','$type','$desc',$weight','$machine','$location')"; $result = @mysql_query($sql); if ($result){ echo json_encode(array('success'=>true)); } else { echo json_encode(array('msg'=>'some errors occured.')); }}?>
use post or instead request first of all.
happens if var_dump of $sql, try execute in phpmyadmin ?
Comments
Post a Comment