Forum Moderators: coopster

Message Too Old, No Replies

A Question of Effciency

Suggestions, Comments, and Pointer Wanted

         

jp_css

7:41 am on Mar 13, 2004 (gmt 0)

10+ Year Member



I have a hidden form on some of my pages that submits a javascript variable into a mySQL database. This variable is large (HTML code) and I don't want to refresh the page. Anyway, I have a part of the code below that waits for this code to be updated in the database (while loop) and then echos that code to the page. This seems pretty inefficent. I can't simple set a variable from the form when it submits because it's in a IFRAME. Any ideas on how I could do this w/o having to repeatedly query the database? Thanks.

jp_css

8:32 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



Anyone have any ideas?

lastcraft

5:06 pm on Mar 14, 2004 (gmt 0)

10+ Year Member



Hi.

Storing HTML in a database does seem very inefficient. DBs are search tools rather than just storage. You will find the file system much more efficient.

I think best is to use the $_SESSION system. It is likely that it works by files already and even if you save sessions to the DB it means that all the session data goes out in a single write.

It's also easier.

yours, Marcus