Keep getting the same error

I keep getting this error, Can anyone spot a problem with the code? I’m pulling my hair out :frowning:

Parse error: syntax error, unexpected '=' in /home/lime01/www/PHP/serverside4/Serverside/cabinUpdate_process.php on line 28
<?php header("Cache-Control:no-cache"); ?>

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>car_update Process</title>
</head>

<body>
  <?php
	/*saves the form data to the database */

	//read data passed via form
	$carID = $_POST['txtcarID'];
	$cartype = $_POST['txtcarType'];
	$cardesc = $_POST['txtcarDesc'];
	$pricepern= $_POST['txtppN'];	
	$priceperw = $_POST['txtppW'];
	$photo = $_POST['txtPhoto'];

	//connect to server and database
	include 'sqldb_connect.inc.php';

	//set up query
   query =  "update tblcars set
			carType='$cartype',
			carDescription='$cardesc',
			pricePerNight='$pricepern',
			pricePerWeek='$priceperw',
			PHOTO='$photo',
			where carID ='$carID'"; // important

	//execute query
	$result = mysql_query($query);

	if(!$result)
	{
		mysql_close();
		exit("Query failed");
	}

	mysql_close();
	exit ("car updated successfully");	
  ?>

</body>
</html>


Appreciate it if anyone could help :slight_smile:

You’re missing the $ in front of query on this line:

query =  "update tblcars set

By the way, you really don’t want to be using the mysql_* functions anymore, as they’ve been deprecated (meaning they’ll be removed from PHP in a future release). Consider using mysqli or PDO instead. Mysqli is pretty similar, so it’s not hard to convert your code.

When i begin to make such errors, i need to go break for 30-15min. Such errors means, that mind is exhausted. After good break you will see such error easily.