Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 MySQL problem

Author  Topic 

Spangle1187
Starting Member

14 Posts

Posted - 2010-12-06 : 10:00:56
Can anyone help with this sql statement please.

I am using php amd MySQL and I cant figure out what is wrong, I have used the variable $data with and without parenthesis and both return the same error:

Warning: mysql_query() [http://www.mysql.com/doc]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()) AND booking.roomID = Room.roomID' at line 3 in /content_ro/webdev/htdocs/schools/hhs/psy_bookings/submit.php on line 65


<?php

$data = $_POST['datepicker'];
echo $data; //as a test method and up to here it is working!

$result = mysql_query( //collects that data from the table
"SELECT `Room`.`roomName`, `booking`.*
FROM Room, booking
WHERE (`booking`.`bookingDate` = $data()) AND booking.roomID = Room.roomID" );

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-12-06 : 10:33:48
SQLTeam is a Microsoft SQL Server site. There's a MySQL forum at http://dbforums.com/ that can help you out.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-12-06 : 10:33:56
The site is for questions about Microsoft SQL Server.

Try asking you question on a website where they answer MySQL questions:
http://www.dbforums.com/mysql/





CODO ERGO SUM
Go to Top of Page

Spangle1187
Starting Member

14 Posts

Posted - 2010-12-06 : 10:38:58
Oops have posted here before obviously while working with access and vs, thanks
Go to Top of Page
   

- Advertisement -