View Full Version : PHP/MySQL Help
MacroGuru
06-27-2008, 12:38 PM
I am playing with the data exported from Stelmacks DB updater and I am working with the gameresults table
I have my query grabbing the data from this table and the teams table, but now I only want to display the most recent week on the site, I don't want to tie it down to the number, how would you go about doing this?
results.week = 6 right now, but I want it to show next weeks when it becomes 7
PHP/MySQL is not my strength.
gstelmack
06-27-2008, 01:10 PM
cur_year = select year from gamedata
cur_week = select max(week) from results where year=cur_year
select * from results where year=cur_year and week=max_week
that's roughly what I do (although it's all ASP.NET / nHibernate for me)
ShaneTheMaster
06-27-2008, 01:50 PM
I have stored procedures that pulls data out of Greg's database, such as Offensive stats, defensive stats, rookies, etc. that you can add to your database. Will that help? That way all you have to do is call the stored procs.
MacroGuru
06-27-2008, 01:53 PM
I have stored procedures that pulls data out of Greg's database, such as Offensive stats, defensive stats, rookies, etc. that you can add to your database. Will that help?
That might help out bit.
ShaneTheMaster
06-27-2008, 01:56 PM
That might help out bit.
PM me your email address, and ill send them as attachments.
gstelmack
06-27-2008, 02:24 PM
You could just attach them straight in here, now that we're on Operation Sports.
ShaneTheMaster
06-27-2008, 02:32 PM
Ok.. let's see.. here we go. Just remember to keep these backed up, because if you have to destroy your database, the procs go too! I learned my lesson. :)
MacroGuru
06-27-2008, 03:02 PM
Ok.. let's see.. here we go. Just remember to keep these backed up, because if you have to destroy your database, the procs go too! I learned my lesson. :)
Thanks a bunch!
cuervo72
06-27-2008, 03:11 PM
Hmm....I think I just rely on the week from gamedata.
ShaneTheMaster
06-27-2008, 03:25 PM
Oh, yea.. forgot to mention.. these procs have 2 parameters, one for the year, and one for the week. If you pass in a 0 for the week, it gets the latest week for that year.
vBulletin v3.6.0, Copyright ©2000-2026, Jelsoft Enterprises Ltd.