Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i got the error

C#
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\CorkiWebsol\SM_Manila\slotAreserve.php on line 14

here is my code
PHP
require('dbconx.php');

$fullname=$_POST['fullname'];
$adress=$_POST['adress'];
$email=$_POST['email'];
$contact=$_POST['contact'];
$date=$_POST['date'];
$starttime=$_POST['starttime'];
$endtime=$_POST['endtime'];

$register="INSERT INTO manilaslota(fullname,adress,email,contact,date,starttime,endtime) VALUES('$fullname','$adress','$email','$contact','$date','$starttime','$endtime')" or die
$result=mysqli_query($db_link,$register);
	header('location:MANILARESERVATION.html');
	
	mysqli.close($db_link);
	
	?>


What I have tried:

i have tried everything i can.
Posted
Updated 28-Mar-16 8:57am
v2
Comments
CHill60 28-Mar-16 13:43pm    
I have amended the title of your post to remove the silly text-speak. There are members who will ignore questions that include "Meeeee", "pls", "pleeeeeese" etc. If you want to be taken seriously then use sensible language. It also makes it easier for people for whom English is not their first language to understand. Also avoid using all capitals - on the internet it is SHOUTING and considered to be rude.

I would start by replacing
PHP
$register="INSERT INTO manilaslota(fullname,adress,email,contact,date,starttime,endtime) VALUES('$fullname','$adress','$email','$contact','$date','$starttime','$endtime')" or die
by
PHP
$register="INSERT INTO manilaslota(fullname,adress,email,contact,date,starttime,endtime) VALUES('$fullname','$adress','$email','$contact','$date','$starttime','$endtime') or die";
 
Share this answer
 
v2
Comments
[no name] 28-Mar-16 15:36pm    
So far so good a 5.
Patrice T 28-Mar-16 15:48pm    
Thank you.
$register is a string variable therefore a following boolean operator is something unexpected
You should use it against the return value of mysqli_query
Better avoid use of die , use proper error handling instead

PHP
require('dbconx.php');
 
$fullname=$_POST['fullname'];
$adress=$_POST['adress'];
$email=$_POST['email'];
$contact=$_POST['contact'];
$date=$_POST['date'];
$starttime=$_POST['starttime'];
$endtime=$_POST['endtime'];
 
$register="INSERT INTO manilaslota(fullname,adress,email,contact,date,starttime,endtime) VALUES('$fullname','$adress','$email','$contact','$date','$starttime','$endtime')";

$result=mysqli_query($db_link,$register) or die ('Unable to execute query.');

mysqli.close($db_link);

header('location:MANILARESERVATION.html');
 
Share this answer
 
Comments
[no name] 28-Mar-16 16:29pm    
A 5 for "Better avoid use of die"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900