Welcome Guest, Not a member yet? Register   Sign In
mysqli multi_query
#1

(This post was last modified: 08-28-2023, 10:02 PM by user44953432.)

I have been searching on how to achieving executing a sql batch using the CI database framework. So far, have not been able to find it. In short, something similar to below is supported?
Code:
$conn->multi_query($sql)

If not, can I still use mysqli directly like done in plain PHP?
Reply
#2

You can use Custom Function Calls. See docs.
Reply
#3

(This post was last modified: 08-29-2023, 09:24 AM by user44953432.)

Have seen that. That one allows a procedure or function to be called. Due to some restrictions, I cannot go that route and have to fire a “batch of Sql queries” like you would do in a front end DB UI.

Is this possible using CI database or I have to go directly with MySQLi based code?

On a side note, I noticed this in my logs:

CRITICAL - 2023-08-29 12:12:51 --> ...
...
CRITICAL - 2023-08-29 16:16:10 --> syntax error, unexpected token "->"
...
CRITICAL - 2023-08-29 12:17:13 --> ...

For the error "syntax error", the log timing is probably getting logged in UTC vs every other log which is in my local timezone. Looks like a bug in CI logger?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB