Jump to content

Archived

This topic is now archived and is closed to further replies.

php_b34st

ajax, javascript and mysql

Recommended Posts

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

Share this post


Link to post
Share on other sites

no i dont need to update the fields i need to enter certain values into a different table

Share this post


Link to post
Share on other sites

I'm not sure I entirely understand what it is you are trying to do.

 

Do you have a semi-working model hosted yet?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Its late now so i will give it another try 2morro again thanks for all the help its much appreciated.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.