Image is being save to the folder in db but other information is not being save

becca

New Member
Need help above code is saving image to a folder(photos) define in the above code. but the other data which is being post by a form is not being save to database...I am new to php and i found this code from a website www.jeasyui.com. so i try to modified it but fail..as usual.:(\[code\]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 into 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.'));}}?>\[/code\]
 
Top