Welcome Guest, Not a member yet? Register   Sign In
Looping through mysql queries?
#3

[eluser]Guest[/eluser]
Dirk!!

That works amazing! Thanks so much :-) :-)

You did in 2 lines what i would have tried to do with Loops and FORs and explodes :-)


It kind of makes me think how bad the rest of my code will be :down:
I guess i could always optimize in the future if the site takes off.


Could someone please explain how i can change this line:
Code:
$arr_result = $this->db->query('SELECT DISTINCT tryItems FROM users WHERE trypage = \'BOB\' LIMIT 1')->result_array();

To use the Query Bindings

Code:
$sql = 'DISTINCT tryItems FROM users WHERE trypage = ? LIMIT 1';
$this->db->query($sql, array($name));

I do not understand where this bit: "->result_array();" would fit into it?

Thanks again for the help! Smile


Messages In This Thread
Looping through mysql queries? - by El Forum - 02-14-2010, 06:03 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 07:38 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 08:00 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 08:26 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 01:56 PM
Looping through mysql queries? - by El Forum - 02-15-2010, 12:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB