|
|
php and mysql problem
|
|
|
|
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status:
Offline
|
|
I have a php/mysql site setup but I'm having issues with mysql. What I'm trying to do is post the point results for our fantasy nascar league. I enter the racedate, member, and points. But when I do a select for that race it doens't return any records. This does work by the end of the week (Friday-ish), just not after entering.
I also have a running total of the points, that sql query works fine. It includes all races incuding the last entered race.
The site is located at:
http://tangentmotorsports.dyndns.org...orts/index.php
I have it showing the sql statemets at the moment to help troubleshoot.
Is there something i'm missing? Thanks.
|
Peter Leing
17" 1.67GHz PowerBook
450MHz G4 Cube
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2001
Status:
Offline
|
|
Instead of:
SELECT Crew.Nickname, NascarFantasyPoints.Points FROM Crew INNER JOIN NascarFantasyPoints ON Crew.MemberNumber = NascarFantasyPoints.MemberNumber WHERE NascarFantasyPoints.RaceDate='2002-09-07' ORDER BY NascarFantasyPoints.Points DESC;
Why don't you try:
SELECT c.Nickname, n.Points
FROM Crew c, NascarFantasyPoints n
WHERE c.MemberNumber=n.MemberNumber
AND n.RaceDate='2002-09-07'
ORDER BY n.Points DESC
Same results, alot less typing = alot less chances to make mistakes.
Can you please clarify your question - all of the queries look like they work.. Exactly which section doesn't work?
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status:
Offline
|
|
I'll try changing the query when I get home tonight.
If you visit the site you will see what I'm talking about. What I'm trying to do is display the weekly points in the left hand column. The Sept. 23rd, entry doesn't list the points for that race, even though the entries are in the database.
I know the database entries are in there because a) I entered them and b) they are added to the point totals in the table on the top right.
My question is, why can I not pull those records from the database?
|
Peter Leing
17" 1.67GHz PowerBook
450MHz G4 Cube
|
|
|
|
|
|
|
|
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status:
Offline
|
|
I've replaced my SQL query with the one you suggested, but it still doens't work. Any other suggestions?
|
Peter Leing
17" 1.67GHz PowerBook
450MHz G4 Cube
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 1999
Status:
Offline
|
|
I think you need to add a GROUP BY clause. And you were better off with the INNER JOIN statement, though the current one functions in an identical manner. Can you post some data from the tables? Like two fields from each? I'm much better at this when I can just look at the data and manipulate it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|