CodeIgniter Forums
How to transform this code to a good query function? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to transform this code to a good query function? (/showthread.php?tid=18836)



How to transform this code to a good query function? - El Forum - 05-20-2009

[eluser]Pachara Chutisawaeng[/eluser]
for($i=1;$i<=3;$i++){
$score = array("s_score"=>$_POST[$i]);
$this->db->where('s_no',$i);
$this->db->update("score",$score);
}

Please help me, i am The NOOBY


How to transform this code to a good query function? - El Forum - 05-20-2009

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

Please try to remember to wrap your code in [code][/code] tags.

If you could show a bit more code to give us an idea of the context of the code, someone might be able to help you a bit better. At the moment, I don't understand what you're asking.


How to transform this code to a good query function? - El Forum - 05-20-2009

[eluser]Dam1an[/eluser]
Fuzzy already covered the formalities about code tags, so I won't repeat that part

Are you trying to do this in a single query instead of 3 or what? What do you mean by 'good query function'?