bretthexum Posted February 22, 2011 Share Posted February 22, 2011 Hi guys, I've spent quite a bit of time searching the site and have a good start - hoping for some help. I run a hockey league and have a database that keeps our stats. Regular stats page is here - http://okchockey.com/stats/stats.php I need a web form that can update existing records in the database. Maybe I am going thru this the wrong way - please let me know. I know there's a better way than my current version. Basically I have a table that has fields of Week, Jersey, Name, Goals, Assists, Points, and Penatly_Min. Again - excuse the newbie-ness - what I did is have a record for each player for each week. I already pre-created a record for each player for each week. I just need a web form that will update these existing records. I already created one that can add new records but I am having a tough time creating one to update existing ones. I'd like to be able to select the week (week 1-10) then select a player and update his stats for that particular week. Hopefully this makes sense. If anyone has some sample code I can look at I'd sure appreciate it. Really struggling trying to teach myself PHP Quote Link to comment Share on other sites More sharing options...
Zurev Posted February 22, 2011 Share Posted February 22, 2011 Have you thought about copying the form over and trying to use it without the insert sql statement? Using an UPDATE WHERE statement instead of INSERT since you're updating an existing row should get you headed in the right thought process. http://www.w3schools.com/sql/sql_update.asp Quote Link to comment Share on other sites More sharing options...
bretthexum Posted February 23, 2011 Author Share Posted February 23, 2011 Thank you, that's a good start. I'll post what I have later on. I'll need to update quite a few entries at once Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.