NYCPHP Meetup

NYPHP.org

[nycphp-talk] Anyone know why the "select" query will die?

Chris Shiflett shiflett at php.net
Thu Aug 21 16:37:31 EDT 2003


--- Phil Powell <soazine at erols.com> wrote:
> On occasions the "select" query will die for no apparent reason.
> The "insert statement" is nullified and not done either. However,
> upon the user hitting the back browser button and resubmitting both
> work fine and then continue to work fine for an indeterminate amount
> of time.

Maybe you should output mysql_error() on failure. That will be far more
informative than any guess I can make. You could have too many connections or
any number of other errors that could cause sporadic behavior.

> Perhaps I'm missing something here: what I'm trying to do is insert
> a new record and immediately obtain the id column field value from
> the new record.

You should use the function for tht and save yourself a query:

http://www.php.net/mysql_insert_id

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



More information about the talk mailing list