Welcome Guest, Not a member yet? Register   Sign In
How to transform this code to a good query function?
#1

[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
#2

[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.
#3

[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'?




Theme © iAndrew 2016 - Forum software by © MyBB