|
|
|
ช่วยหน่อยค่ะ เกิด Error แบบนี้ค่ะ Error in Selecting Unknown column |
|
|
|
|
|
|
|
เกิด Error แบบนี่ค่ะ Error in Selecting Unknown column 'Restaurant_Lati' in 'field list'
Code (PHP)
<?php
if(trim($_FILES["fileUpload"]["tmp_name"]) != "")
{
$images = $_FILES["fileUpload"]["tmp_name"];
$new_images = "Thumbnails_".$_FILES["fileUpload"]["name"];
copy($_FILES["fileUpload"]["tmp_name"],"trip_img/".$_FILES["fileUpload"]["name"]);
$width=300; //*** Fix Width & Heigh (Autu caculate) ***//
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,"rest_img/".$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
$Restaurant_Name = $_POST['Restaurant_Name'];
$Restaurant_Lati = $_POST['Restaurant_Lati'];
$Restaurant_Longi = $_POST['Restaurant_Longi'];
$Restaurant_Address = $_POST['Restaurant_Address'];
$Restaurant_Tel = $_POST['Restaurant_Tel'];
$Trip_ID = $_POST['Trip_ID'];
$host="localhost"; //replace with your hostname
$username="root"; //replace with your username
$password=""; //replace with your password
$db_name="mytrips"; //replace with your database
//open connection to mysql db
$connection = mysqli_connect($host,$username,$password,$db_name) or die("Error " . mysqli_error($connection));
$sql = "INSERT INTO restaurant(Restaurant_Name, Restaurant_Lati, Restaurant_Longi, Restaurant_Address, Restaurant_Tel, Restaurant_Image, Trip_ID) VALUES('$Restaurant_Name', '$Restaurant_Lati', '$Restaurant_Longi', '$Restaurant_Address', '$Restaurant_Tel', '$new_images', '$Trip_ID')";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));
//$numrow=mysqli_num_rows($result);
if(($result)){
header("location:mng_trip_admin_res.php");
}else{
echo'cannot upload complete';
}
}
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2016-01-31 03:49:14 |
By :
narslins_mc |
View :
663 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|