Date & php & SQL
Posted: Fri Dec 03, 2010 4:37 am
I am a newbie to php and working on my first project:
I have created a MySQl database and working on some functionality between the php page and MySQL db. I have connected the php page to the db but I am now trying to pass a date variable into a mysql_query and keep getting the following error:
Parse error: parse error in C:\wamp\www\NEW Booking Folder\index.php on line 5
I have created a MySQl database and working on some functionality between the php page and MySQL db. I have connected the php page to the db but I am now trying to pass a date variable into a mysql_query and keep getting the following error:
Parse error: parse error in C:\wamp\www\NEW Booking Folder\index.php on line 5
Code: Select all
include("php/dbconnect.php"); //connects to the database
//
var $date = CURDATE();
$result = mysql_query( //collects that data from the table
"SELECT `Room`.`roomName`, `booking`.*
FROM Room, booking
WHERE (`booking`.`bookingDate` =$date)"
);
//inserts the bookings data into an array called info
$info = mysql_fetch_array($result);