Gnub Posted March 7, 2007 Share Posted March 7, 2007 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 Link to comment https://forums.phpfreaks.com/topic/41648-solved-sql-issue-in-where-clause-is-ambiguous/ Share on other sites More sharing options...
effigy Posted March 7, 2007 Share Posted March 7, 2007 What does the SQL statement look like after all the variables have been added? Link to comment https://forums.phpfreaks.com/topic/41648-solved-sql-issue-in-where-clause-is-ambiguous/#findComment-201817 Share on other sites More sharing options...
Gnub Posted March 7, 2007 Author Share Posted March 7, 2007 just looked at that, forgot to link the columns to one of the tables, in the variables. bah. sorry for the waste of time. Link to comment https://forums.phpfreaks.com/topic/41648-solved-sql-issue-in-where-clause-is-ambiguous/#findComment-201819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.