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

[eluser]Unknown[/eluser]
Hello obiron2,

Thanks for replying.

Quote:put quotes round your SQL string, otherwise PHP sees the first semicolon and thinks it is the end of the PHP command.

I've already done that. And put also the sql statement on one line.

I don't want to use procedures because of portability.

Also, I think you have a misunderstanding about the way MySQL use temporary table.

Quote:Temporary tables differ from normal tables in that temporary tables exist only
for the duration of the current session and are automatically deleted after it ends.
(For web applications, this means that temporary tables generally cease to exist
upon completion of the current page or script.)
http://dev.mysql.com/tech-resources/arti...n-ch5.html (p264 of the referred PDF)

And...

Quote:A MySQL temporary table can have any legal name, even the same name as an existing regular table. In this case it will mask the regular table.

http://www.xaprb.com/blog/2006/03/26/tem...-in-mysql/

Cheers
-Emmanuel


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



Theme © iAndrew 2016 - Forum software by © MyBB