iceblox Posted April 30, 2008 Share Posted April 30, 2008 For what im trying to do i think i need run it through an array? how would i array a result so that it performs that action for each entry and not just the last one? Quote Link to comment Share on other sites More sharing options...
p2grace Posted April 30, 2008 Share Posted April 30, 2008 We need some code. For a general understanding of arrays check out: http://us2.php.net/array Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 30, 2008 Share Posted April 30, 2008 need to know what you mean by "result" is that a MySQL result? a form result? A result of adding something together? what do you mean? sorry, I'm just not sure what you are talking about when you say result. Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 Sorry my apologies trying to do two things at once. I have this code if(!empty($_POST["savebutton"])) { $result = $db->sql_query("UPDATE ".$prefix."_leaderboardteam SET tpoints='".forSql($_POST["tpoints"])."' WHERE leadid ='".forSql($_POST["leadid"])."'"); if($result) $status = "<b>".$_POST["leadid"] . " successfully updated</b>"; else { echo "<b>You have broken it!</b>"; print_r($db->sql_error($result)); } } And there are many rows that need to be updated in one click how would i put that code into an array? Thanks Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Use a while loop. >_> Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 any examples? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Now, what do you mean "for each entry"? Is there a form with a multiple select field? >_> Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 Yeah, basically there is a list with all the teams on to update the points. you simply put the points in and then click save to update all the entries at the same time. Currently it is only updating the last one in the list. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Can you possibly link me to a screenshot of the page, or link me to the page? I just want to see what the form looks like, and then I can help you with no problem. =) Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 Basically where the numbers are this will change to input boxes with the submit button below [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 How are you passing the IDs of the teams? Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 i posted them using a hidden tag so i am calling them via POST on the where clause Quote Link to comment Share on other sites More sharing options...
iceblox Posted April 30, 2008 Author Share Posted April 30, 2008 Anyone? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Check my PM. 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.