Jump to content

[SOLVED] SQL issue, in where clause is ambiguous


Gnub

Recommended Posts

I have this query, im not sure how to fix it. i've highlighted the part of the query where i know the problem is, but as i said, im not sure how to fix it.

 

String values are the criteria provided by a user in the previous form.

 

Tables:

Teletext

Hotels

Rate

Board

 

Out of the criteria provided, the query will return data provided within the criteria provided in the form.

 

sqlQuery = "Select `Teletext`.*, `Hotels`.*, `Rate`.Image, `Board`.FBoard, DATE_FORMAT
(`DepartureDate`, '%a %D %b') AS revised_date FROM `Teletext`,`Hotels`,`Rate`,`Board` WHERE
`Teletext`.Group = `Hotels`.AccomID AND `Teletext`.Rating=`Rate`.Rating AND `Teletext`.Board
=`Board`.SBoard AND " & Departure &  Destination & DateTo & DateFrom & mnuBoard & mnuNights &
mnuStars & " ORDER by PRICE ASC Limit 1;"

 

Code Breakdown from WHERE:

 

`Teletext`.Group = `Hotels`.AccomID  --- Both columns hold same data type

AND `Teletext`.Rating =`Rate`.Rating  --- Both columns hold same data type

AND `Teletext`.Board =`Board`.SBoard --- Both Columns hold same data type

AND " & Departure &  Destination & DateTo & DateFrom & mnuBoard & mnuNights & mnuStars & " --- Variables holding data provided by user.

 

Like i said, i dont know why this ambiguous part is confused.

 

thnx in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.