Copy link to clipboard
Copied
On my testing server, everything works fine. Exact same code and data. On the live server, ColdFusion displays 0 instead of correct values. Please see below.
RESULTS on my computer:
Division 1 TAHSXxxxxxx, Daniel Xxxxx@gmail.com Paid: 45.00 Division: 1 Division 2 SCHSXxxxxx, Deborah Xxxxx@gmail.com Paid: 45.00 Division: 2 Division 3 DHSXxxxxx, StevePaid: 45.00 Division: 3WDHS Xxxxxx, Val Xxxxx@gmail.com Paid: 50.00 Division: 3 |
Results on Live Server:
Division 1 TAHS Xxxxxxx, Daniel Paid: 45.00 Division: 0 Division 0 SCHS Xxxxxxx, Deborah Paid: 45.00 Division: 0 DHS Xxxxxx, Steve Paid: 45.00 Division: 0 WDHSXxxxxx, Val Xxxxx@gmail.com Paid: 50.00 Division: 0 |
My Query:
<cfquery name="get_nominees" datasource="xxxxx" username="xxxxx" password="xxxxx">
SELECT confirmed, academic_team_id, last_name, first_name, email, paid, division ,name
FROM academic_teams, coaches, schools
WHERE academic_teams.coach_id=coaches.coach_id
AND academic_teams.school_id=schools.school_id
ORDER BY division, name
</cfquery>
My CFOUTPUT:
<cfoutput query="get_nominees" group="division">
<div style="font-weight:bold; background-color:##CCCCCC; width:300px;">Division #division#</div>
<cfoutput>
<strong>#name#</strong><br />
#last_name#, #first_name#<br />
#email#<br />
Paid: #paid# <br />
Division: #division#<br /><br />
</cfoutput>
</cfoutput>
My DATA
"confirmed" | "academic_team_id" | "last_name" | "first_name" | "email" | "paid" | "division" | "name" |
"0" | "3" | "Xxxxxx" | "Daniel" | "Xxxxx@gmail.com" | "45.00" | "1" | "TAHS" |
"1" | "4" | "Xxxxxx" | "Deborah" | "Xxxxx@gmail.com" | "45.00" | "2" | "SCHS" |
"0" | "5" | "Xxxxxx" | "Steve" | "Xxxxx@gmail.com" | "45.00" | "3" | "DHS" |
"0" | "6" | "Xxxxxx" | "Val" | "Xxxxx@gmail.com" | "50.00" | "3" | "WDHS" |
Any help would be greatly appreciated.
Copy link to clipboard
Copied
When you run your query against the live database without using ColdFusion, do you get the correct number of rows?
Copy link to clipboard
Copied
I suspect your DSN on the live box is not pointing to where you think it is.
--
Adam
Copy link to clipboard
Copied
Adam Cameron. wrote:
I suspect your DSN on the live box is not pointing to where you think it is.
--
Adam
It's correct. I use third party hosting. I only know one way in. This code previously worked on the live server. Could a mySQL or ColdFusion upgrade affect it?
Copy link to clipboard
Copied
It's correct. I use third party hosting. I only know one way in.
This code previously worked on the live server. Could a mySQL or ColdFusion upgrade affect it?
Well... in that case... I have no idea WTH is going on 😞
--
Adam
Copy link to clipboard
Copied
Adam Cameron. wrote:
Well... in that case... I have no idea WTH is going on 😞
Bummer. Thanks for trying.
Copy link to clipboard
Copied
Well... in that case... I have no idea WTH is going on 😞
Bummer.
Thanks for trying.
Can you perhaps try a different MySQL driver than the default CF one? That's a longshot though.
And if no-one else has any ideas but you do work out what's going on, can you post back here?
--
Adam
Copy link to clipboard
Copied
Dan Bracuk wrote:
When you run your query against the live database without using ColdFusion, do you get the correct number of rows?
Yes. The My DATA is the MySQL result.
Copy link to clipboard
Copied
If the data is there when you run the query outside of coldfusion, what happens is you simply dump the recordcount or something when you run it inside coldfusion? Do you get 0 rows, or the expected number?
Copy link to clipboard
Copied
Dan Bracuk wrote:
If the data is there when you run the query outside of coldfusion, what happens is you simply dump the recordcount or something when you run it inside coldfusion? Do you get 0 rows, or the expected number?
Dan, please forgive - either I'm not understanding you or I'm not explaining my problem well enough.
The rows are all returning, but the value of the field "division" is showing as 0 for 3 of the four rows. In reality, none of the four rows have a value of 0 in the division field. I'm grouping the results by division.
Thanks
Copy link to clipboard
Copied
Earlier you said, "The My DATA is the MySql result." in response to, "what happens when you run the query outside of ColdFusion". Later you say, "In reality, none of the four rows have a value of 0 in the division field".
Those two statements appear to contradict each other.
Copy link to clipboard
Copied
Dan Bracuk wrote:
Earlier you said, "The My DATA is the MySql result." in response to, "what happens when you run the query outside of ColdFusion". Later you say, "In reality, none of the four rows have a value of 0 in the division field".
Those two statements appear to contradict each other.
Dan, Sorry, I am still not following. There is a table up above right under the phrase My Data. The 7th column in the table is "Division". The values of each row are below and none of the values in the Division column are "0". When ColdFusion outputs the query, it displays the number zero for #division# for every row except those where the value of "Division" is "1".
I've had my web host working on this today and they don't seem to have any ideas yet either. I'll let you know if I figure it out.
Copy link to clipboard
Copied
Resolution!
I'm not sure what the site was running on before, but I think CF8. My web host has now moved the site to Windows 2008 R2 server with ColdFusion 9, which has resolved the issue.
Thanks!