Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > php and mysql problem

php and mysql problem
Thread Tools
pumpkinapo
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status: Offline
Reply With Quote
Sep 23, 2002, 09:52 AM
 
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
     
Raman
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
Sep 25, 2002, 10:53 PM
 
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?
     
pumpkinapo  (op)
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status: Offline
Reply With Quote
Sep 26, 2002, 08:26 AM
 
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
     
pumpkinapo  (op)
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status: Offline
Reply With Quote
Sep 27, 2002, 09:29 AM
 
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
     
rplotkin
Junior Member
Join Date: Nov 1999
Status: Offline
Reply With Quote
Oct 21, 2002, 12:07 AM
 
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.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:47 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,