Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Using mysql variables and stacking mysql calls
#1

[eluser]Unknown[/eluser]
Is there a way to perform the following in CI?

Code:
$this->db->query('SET @rownum = 0; UPDATE eye_colors SET sort_order = 0; UPDATE eye_colors SET sort_order = @rownum:=@rownum+1 ORDER BY color_name');

This works in phpmyadmin, so I need the CI workaround ... stored proc?

Regards,
Scott.
#2

[eluser]Unknown[/eluser]
err.. found the solution in a post titled:

MySQL - Multiple Queries - Any way to chain queries together / execute all in one statement?

Regards,
Scott.




Theme © iAndrew 2016 - Forum software by © MyBB