i am trying to use mysql_pconnect with temporary tables in PHP and mysql. its working fine in file1 when temporary table is created but when i try to access tempTable in file2 it gives error Table 'tempTable' doesn't exist,? why ? b/c temporary table is created with a persistent connection and it should exists for the lifetime of the connection. am i right?

Mysql Ver = 4.0.18-standard
PHP Ver Ver = 4.3.4

Zaid Ansari

    I have no idea if you're right because I don't see any code for me to look at.

    I notice you've included a text file with your post... is there a reason you cannot simply copy and paste your code into the post? That would be less dangerous for all of the people trying to help than to open attachments.

    Post again, but include your code and where you suspect is the problem. I can help afterwards.

      That's a toughie, zaansari. In theory, it should work. However, persistent connections really are supposed to do one thing: reduce the overhead of making a SQL connection on a busy server. Other than that, a persistent connection is supposed to act exactly like a regular connection. This is according to the manual.

      If that truly is the case, then I think persistent connections don't work the way you (or MySQL) expects them to. I'd say, if you can't maintain your access to the temp table, then there isn't much you can do about it.

      ===

      Rachel, while I agree that users need to post code whenever necessary, I don't think that's the case here. He simply asked whether or not persistent connections SHOULD allow you to access a temporary table from two different scripts.

      As for attaching files -- in this case it seems silly to include the file, when there is only one line in it. But I cannot fault anyone for attaching files -- indeed, we sometimes have too many people posting way too much code on the page. Attachments are just fine -- it only takes a second to open them. I don't know what you perceive to be dangerous about opening up a .txt file.

        buzzly, I agree, maybe there is no harm in opening up a text file. Or maybe there is (afterall, who hasn't gotten fooled via IRC when they accepted something from another member and it turned out not to be harmless pics). I cannot say for sure, but I think if a poster wants assistance, it should not be at my computer's expense if I offer it. This is only my opinion, but I felt I should bring it out since you specifically addressed me over my concerns. Probably like you, I spend a great deal of my time on the computer and see no reason in taking unnecessary risks to my home computer or my company's computers/network if I respond while in the workplace.

        In the big picture, though, a poster gets FREE tech support in a forum, so I don't see what is wrong with asking a poster to post his code--one line or more--if it means someone like myself is more willing to respond. If he doesn't want to do that and assumes folks will freely open his attachments, than he alienates a portion of the audience who could respond to him.

        I mean no debate with you over this... you had asked what I could perceive as dangerous about a text file.

          The only thing PHP guarantees to last from one persistant connection invocation to another, is the connection. In fact, with PostgreSQL, the connection lib in php works pretty hard at resetting everything except the connection.

            Write a Reply...