[nycphp-talk] if mysql_query() produces an error....

Phil Powell soazine at
Thu Aug 21 18:17:05 EDT 2003

Re: [nycphp-talk] if mysql_query() produces an error....I think I might have found the problem.. again, proving my limited knowledge of PHP functions (can I switch brains with any of you guys?), I did not know about this:


I was using

$query = ''; mysql_close($dbConn);

This, I thought, from my ASP days, would free the query resources, as it does in ASP, however, in PHP it's not the case.

This might have caused the latent issues involving mysql_select_db() failing.

  ----- Original Message ----- 
  From: Mauricio Sadicoff 
  To: NYPHP Talk 
  Sent: Thursday, August 21, 2003 6:01 PM
  Subject: Re: [nycphp-talk] if mysql_query() produces an error....

  On 8/21/2003 17:27, "Phil Powell" <soazine at> scribbled:

    Then I'm confused.  Why is it then that mysql_select_db() will bomb after the user attempted to enter erroneous data into mysql_query()?  That is, the user enters bad data within mysql_query(); it throws mysql_error() and delivers the page to the user; the user attempts AGAIN to enter somethng and then mysql_select_db dies!  Why does that occur?

  Difficult to say without knowing the page code, but I would var_dump the variables (particularly the queries) prior to running them. Make sure to test the connection state as well. I have a feeling you might be closing it and not reopening. Maybe the call that opens the connection does not show up in the second time you run the page...?

  Best regards,

   Mauricio L. Sadicoff      
   mlevy at

  "Peace of mind isn't at all superficial, really," I expound. "It's the whole thing. That which produces it is good maintenance; that which disturbs it is poor maintenance. What we call workability of the machine is just an objectification of this peace of mind. The ultimate test is always your own serenity." - Zen and the Art of Motorcycle Maintenance.


  talk mailing list
  talk at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list