![]() |
| ||
| the simplest of all queries Hi, I use to be a bit of a wiz at coldfusion 4, but I havent used it in quite a WHILE! Now its at version 7 and what I remember doesnt seem to work anymore... I am trying to write a 'news' page, it takes data from two tables... news and users. It will display the title and story from the news table and the username from the users table. The two tables will be joined by the userid which is the same in both tables.... Here is my query, that use to work in old version 4! <cfquery datasource=#db# name=test> But it just comes up with this error: Quote:
Thanks, William |
| ||
| Re: the simplest of all queries I have not used CF much since version 5... I would try running your query against the database outside of ColdFusion and fetching all the rows. That may help isolate where the problem is. If the problem turns out to be with the query, you may want to check the data type of the columns you are joining. Some database will automatically convert a string to a number which works fine until you bump into a string that cannot be converted because it has alpha characters in it. If they have different data types, try adding a TO_CHAR or TO_NUMBER conversion. |
| ||
| Re: the simplest of all queries You still need to set star per table even though you want all from each. <cfquery datasource=#db# name=test> SELECT news.*, users.* FROM news, users WHERE news.userid = users.userid </cfquery> |
| ||
| Re: the simplest of all queries Quote:
|
| All times are GMT -4. The time now is 11:58 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC