Welcome Guest, Not a member yet? Register   Sign In
MySQL query fail in CI and PHP but not with MySQL client
#2

[eluser]obiron2[/eluser]
put quotes round your SQL string, otherwise PHP sees the first semicolon and thinks it is the end of the PHP command.

I'm not sure what $this->db->query will return when there are multiple statements in your SQL.

you would do better to store the SQL script as a stored procedure inside MySQL - It would be faster and less prone to error.

If you have multiple hits to this function at the same time, you will run the risk of dropping the temptables while you are still using them and you should look at some sort of locking or unique table naming. If you use in-memory (hash) tables they will automatically be dropped on completion of the SQL. don't know if you can have hash tables in MySQL - it may be a MSSQL function.

Obiron


Messages In This Thread
MySQL query fail in CI and PHP but not with MySQL client - by El Forum - 02-05-2009, 03:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB