Davidammit Posted August 19, 2008 Share Posted August 19, 2008 If they need to update a field there is a MySQL Query for updating fields. I believe it is: UPDATE tablename SET columnname=newvalue WHERE condition Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619672 Share on other sites More sharing options...
php_b34st Posted August 19, 2008 Author Share Posted August 19, 2008 no i dont need to update the fields i need to enter certain values into a different table Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619674 Share on other sites More sharing options...
Davidammit Posted August 19, 2008 Share Posted August 19, 2008 I'm not sure I entirely understand what it is you are trying to do. Do you have a semi-working model hosted yet? Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619676 Share on other sites More sharing options...
php_b34st Posted August 19, 2008 Author Share Posted August 19, 2008 I have a players database with over 1000 entries in it a user has to pick 11 of these players to form their team this script checks the db and gets all the info out for the playercode they enter once i have done all the calculations and approved the team I will add the playercodes into the teams database. No sorry I do not have the hosting yet and am just working from localhost Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619681 Share on other sites More sharing options...
Davidammit Posted August 19, 2008 Share Posted August 19, 2008 oh I think I get it. You could change it so the PHP code does all the queries at once and the fields keep their values. That way if they screw up, they can change it easily. Then maybe have the PHP part generate a confirm button in with its response. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619684 Share on other sites More sharing options...
php_b34st Posted August 19, 2008 Author Share Posted August 19, 2008 Yeah thats what I am trying to do but I cant get the php to query it all at the same time unless i submit the form. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619685 Share on other sites More sharing options...
Davidammit Posted August 19, 2008 Share Posted August 19, 2008 Couldn't you make one button for checking the team and another button for the final submit though? Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619688 Share on other sites More sharing options...
php_b34st Posted August 19, 2008 Author Share Posted August 19, 2008 Yea I can do that or I could check the team as they submit it but I was trying to get it all done instantly so if the team is approved the submit button appears if not it doesnt but an error message explaining why it wasnt approved will be displayed. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619691 Share on other sites More sharing options...
Davidammit Posted August 19, 2008 Share Posted August 19, 2008 How were you planning to approve the team? Would a person be doing it or would it be based off player stats? If it was based off player stats I would do it PHP side and make a code to the effect of if ( APPROVED ) { echo '<input type="submit">'; } else { echo '<input type="button" onclick="notApproved($reason)">'; } and then have a button on the main form that has the effect of sending all the players to the PHP file for checking and display. If they mess up the first button would still be there so they could try again. And if they didn't they could click on the submit button. If it wasn't approved they would have a button to check why. You could store the non-approval reasons on the JavaScript side or have it retrieve them somehow. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619694 Share on other sites More sharing options...
php_b34st Posted August 19, 2008 Author Share Posted August 19, 2008 Its late now so i will give it another try 2morro again thanks for all the help its much appreciated. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619696 Share on other sites More sharing options...
Davidammit Posted August 19, 2008 Share Posted August 19, 2008 No problem. I hope you solve the problems. Link to comment https://forums.phpfreaks.com/topic/120247-ajax-javascript-and-mysql/page/2/#findComment-619697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.