Welcome Guest, Not a member yet? Register   Sign In
can temporary tables be used in PHP?
#12

(This post was last modified: 09-29-2022, 06:29 AM by richb201.)

table_exists() doesn't work for temporary tables, the result is always false.  <<<<

THANK YOU! I use Koolrepport to generate a report. This is the main output of my app. The report is pretty big and consists of all kinds of data sliced and diced. That is the reason I am building the temp files. I have no need to keep them. I also figured that the speed of operations would be increased by using tables in RAM, like the old RAM drives we used to use way back,,,. If I knew table_exists didn't work for temp tables that would have saved me lots of angst!

What I do is build the temp tables for 10 years at the same time. Then a user can chose which year they want a report for. They can then print it and then chose another year without my code recalculating. It worked very smoothly until I started load testing with Jmeter. With jmeter I needed to delay starting reports for 5 or 6 seconds each. I finally realized that my creation of the temp table wasn't working due to some SQL errors. CI3 didn't report those errors.  I tested it in mysqlWorkBench and fixed it (the sql error). BUT table_exists still didn't show the table existing!

So, what makes a different session? a different function? How can I check this?

Your code above is in a single function. That should work. I actually have mine split into a two functions in a model. And a user can run a subreport, directly from the first report. Is that a new session? I have no idea. What can I look at to determine if I am still in the original session?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: can temporary tables be used in PHP? - by richb201 - 09-29-2022, 06:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB