[GLLUG] [ot]MySQL/PHP

Brad Fears fearsb@michigan.gov
Thu, 28 Feb 2002 07:59:15 -0500


Use the PHP function mysql_error(), but beware that the output is not necessarily "user friendly", so you may want to check for a match of the exact mysql_error string, and create you're own error message based on that.

See http://www.php.net/manual/en/function.mysql-error.php

--Brad Fears

>>> Mike Szumlinski <szumlins@msu.edu> 02/27/02 11:07PM >>>
Good call. 

I'm new to the whole MySQL/PHP thing so bear with me on all of this.

Now what would be the best way to inform the user if they did duplicate the
address (ie, the server wouldn't accept the INSERT, but how does the user
know it didn't?)

-Mike

On 2/27/02 9:56 PM, "Ben Pfaff" <blp@cs.stanford.edu> wrote:

> I would just make the email column UNIQUE in the database schema,
> so that an attempt to insert a duplicate row would be rejected
> automatically by the database server.

-=--===---===---===---===-=-
|Mike Szumlinski           |
|Michigan State University |
-=--===---===---===---===-=-
"We are what we repeatedly do. Excellence, then, is not an act, but a habit"

                                                                 -Aristotle


_______________________________________________
linux-user mailing list
linux-user@egr.msu.edu 
http://www.egr.msu.edu/mailman/listinfo/linux-user