Welcome! Log In Create A New Profile

Advanced

Parse error: syntax error

Posted by 46620710 - Pappy 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Parse error: syntax error
October 16, 2012 11:28AM
Hi Mac,

I seem to be stuck, I am actually trying to sort out my errors and im not sure if I am missing out someting or not. Am I too blind to see the obvious. I keep getting an error"Parse error: syntax error"and it is coming on the last time of my code but I dont see anything missing.The error is said to be on the last line of my codes, which is the php tag. Is there anyone that can help be debug this code. Help is needed ASAP



<?php

include('connect.php'winking smiley;						//connecting to our database 

if (isset($_POST['vehicle_name'])){

$vehicle_name= mysql_real_escape_string($_POST['vehicle_name']);

$query_vehicle_name = mysql_query("SELECT * FROM vehicle WHERE vehicle_name='".$vehicle_name."'"winking smiley;  

if($row=mysql_fetch_assoc($query_vehicle_name)){
echo "The vehicle information already exist<br />";
}
else{
 $vehicle_id=$_POST['vehicle_id'];
 $vehicle_type=$_POST['vehicle_type'];
 $vehicle_name=$_POST['vehicle_name'];
 $vehicle_model=$_POST['vehicle_model'];
 $vehicle_price=$_POST['vehicle_price']; 
 
$my_database = "INSERT INTO vehicle(vehicle_type,vehicle_name,vehicle_model,vehicle_price) VALUES ('$vehicle_type', '$vehicle_name', '$vehicle_model', '$vehicle_price'winking smiley";
 $result = mysql_query($my_database)					 
 or die("Query failed: " .mysql_error());				

echo "<center>The vehicle type $vehicle_type, brand name $vehicle_name, and the year model of $vehicle_model with the price of R $vehicle_price -00 has been inserted in our database!</center>"; 
?>	

Re: Parse error: syntax error
October 16, 2012 11:40AM
Hi Mac,

Its not a problem anymore. I did a better read up on the error. Silly me just forgot to add 2 brackets.thumbs up smiley

Thanks.
avatar
Mac
Re: Parse error: syntax error
October 17, 2012 08:27AM
Remember to ask the question in general - not to me only....
Re: Parse error: syntax error
October 21, 2012 07:42PM
Will do in future Sir.

I do have one more question that I think will relate to you only since you will be marking our project. On the tutorial letter 101, you give us just a basic understanding of what we need to do in our project.

I do believe that if we want to do well in this project we need to add a bit more for our project to be outstanding but my question is if we just fellow your basic instructions in tutorial letter 101 of what you want each function

to do. Will we pass or would you fail us, expecting us to do much more?

Thanks.
Re: Parse error: syntax error
October 21, 2012 08:49PM
+1 to Pappy's last question
avatar
Mac
Re: Parse error: syntax error
October 22, 2012 06:49AM
If it works you cannot fail. How you code it gives you better marks yes.
Re: Parse error: syntax error
October 22, 2012 07:48AM
So extra marks won't be awarded for extra work?
avatar
Mac
Re: Parse error: syntax error
October 22, 2012 08:53AM
That is what the sentence " How you code it gives you better marks yes" alludes to....
Sorry, only registered users may post in this forum.

Click here to login