Link to home
Create AccountLog in
Avatar of AHMED SAMY
AHMED SAMYFlag for Egypt

asked on

small help

<?php

	$localhost="*******";[embed=file 1213257]
	$db_users="*********";
	$db_password="**************";
	$db_name="********";

	$connect=mysqli_connect("$localhost","$db_users","$db_password","$db_name");
	
	if($connect){
		
		if ($_POST['submit']){
			
			$datepic=$_POST['datepic'];
			$duration=$_POST['duration'];
			$Adults=$_POST['Adults'];
			$Childs=$_POST['Childs'];
			$Rooms=$_POST['Rooms'];
			$Destination=$_POST['Destination'];
			$Tour=$_POST['Tour'];
			$Name=$_POST['Name'];
			$Email=$_POST['Email'];
			$Number=$_POST['Number'];
			
			if (empty($Name) && empty($Email) && empty($Number)){
				echo "<script type='text/javascript'> alert('please insert data to proceed')</script>";
			}
			else{
				$sql="INSERT INTO enquiry(datepic,duration,Adults,Childs,Rooms,Destination,Tour,Name,Email,Number) VALUES('$datepic','$duration','$Adults','$Childs','$Rooms','$Destination','$Tour','$Name','$Email','$Number')";
															
				$result=mysqli_query($connect,$sql);
				echo "<script type='text/javascript'> alert('saved successfully...')</script>";
						
				}
		}
	}
						
?>

Open in new window



i didn't save and no message after save refresh only nothin happen no error

attached my table image
2.jpg
ASKER CERTIFIED SOLUTION
Avatar of AHMED SAMY
AHMED SAMY
Flag of Egypt image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account