Error Message Sql

July 13, 2009 10:33 am | Error Message

SQL duplicate error message?

“Error: Duplicate entry ‘user1′ for key ‘username’”

What do I need to do so it returns “That username is already registered” instead?
I can’t get it to work. Here’s what I have:

if($_POST && !empty($_POST['username']) && !empty($_POST['pwd'])) {
if ($_POST['pwd'] == $_POST['pwd2']) {
$sql=”INSERT INTO users (username, password)
VALUES (‘$_POST[username]‘, md5(‘$_POST[pwd]‘) )”;

if (mysql_error()) {
die (“That username is already registered”);
}

Also, I realise that I need to fix that SQL query.
Never mind, I got it.

Most likely, you have set `username` as unique.
This generates an error if you try to enter the same user.
In this case, after your mysql_query(“insert into `table`… )
insert:
if ( mysql_error ( ) )
return (“That username is already registered”)
(you can also make sure that the error is for “duplicate”, by checking the string returned by mysql_error().)


Wiley CPA Exam Review 2011 Test Bank CD , Complete Exam


Wiley CPA Exam Review 2011 Test Bank CD , Complete Exam


$98.44


The key to CPA Exam success is practice, practice, and more practice!Highly organized, up-to-date, comprehensive Multiple-choice questions and their solutions help you sharpen your problem-solving skills Simulation questions and solutions address the new 2011 task-based exam format The most effective system available to prepare and practice for the CPA Exam All current AICPA content requirements i…

ORACLE Database Documentation Set Version 6.0A (9-Manual Box Set)


ORACLE Database Documentation Set Version 6.0A (9-Manual Box Set)



Book Set of 9 Manuals by Oracle Corporation for technical professionals and computer programmers. as well as non-programmers wishing to use SQL and the Relational Data Management System (RDMS)….


Visual Studio 2010 Premium with MSDN Renewal


Visual Studio 2010 Premium with MSDN Renewal


$1,349.00


Microsoft Visual Studio Premium w/MSDN Retail 2010 English Programs Not to Latam Renewal*****Build-to-Order sku from Microsoft. Non-cancellable and Non-returnable.****** Box only includes a card to allow end-user to submit activation of their subscription. It does NOT include a DVD….

Visual Studio 2010 Ultimate with MSDN Renewal


Visual Studio 2010 Ultimate with MSDN Renewal


$2,799.00


Microsoft Visual Studio Ultimate wMSDN Retail 2010 Renewal*****Build-to-Order sku from Microsoft. Non-cancellable and Non-returnable.******…

Error Message


Error Message


$116.3


Please note that the content of this book primarily consists of articles available from Wikipedia or other free sources online. An error message is information displayed when an unexpected condition occurs, usually on a computer or other device. On modern operating systems with graphical user interfaces, error messages are often displayed using dialog boxes. Error messages are used when user intervention is required, to indicate that a desired operation has failed, or to relay important warnings (such as warning a computer user that they are almost out of hard disk space). Error messages are seen widely throughout computing, and are part of every operating system or computer hardware device. Proper design of error messages is an important topic in usability and other fields of humancomputer interaction. Author: Miller, Frederic P./ Vandome, Agnes F./ McBrewster, John Binding Type: Paperback Number of Pages: 184 Publication Date: 2011/02/14 Language: English Dimensions: 5.98 x 9.02 x 0.42 inches

You're screwed error message  Funny Mug by CafePress


You’re screwed error message Funny Mug by CafePress


$15


It’s an error message you hope to never see on your computer. You’re screwed. Damn. It’s a funny, mildly offensive computer design that will make you laugh out loud. Great for computer geeks. Funny Mug The perfect size for your favorite morning beverage or late night brew. Large, easy-grip handle. Treat yourself or give as a gift to someone special. Measures 3.75 tall, 3 diameter. Dishwasher and microwave safe.

Windows Error Message  Geeks / technology White T-Shirt by CafePress


Windows Error Message Geeks / technology White T-Shirt by CafePress


$22


Windows are known for their bugs. Show your suport with this great Windows error message that tells people not to stare at your error message. Geeks / technology White T-Shirt Tee, TShirt, Shirt The white t-shirt is a timeless classic for a reason; it should be a staple in every wardrobe. It is clean, simple, and durable. The best part is you can wear it with anything. This 100% cotton T-shirt is so comfortable you’ll want to wear it to bed.

You're screwed error message  Funny Tile Coaster by CafePress


You’re screwed error message Funny Tile Coaster by CafePress


$10


It’s an error message you hope to never see on your computer. You’re screwed. Damn. It’s a funny, mildly offensive computer design that will make you laugh out loud. Great for computer geeks. Funny Tile Coaster Liven up any room or party with our fun, hip tile coasters, measuring 4.25 x 4.25 and 1/6-inch thick. Images are applied with a polyester resin that accepts dye as part of the coating. Four felt pads protect your furniture from scratches. Dish

You're screwed error message  Funny Rectangle Magnet by CafePress


You’re screwed error message Funny Rectangle Magnet by CafePress


$5


It’s an error message you hope to never see on your computer. You’re screwed. Damn. It’s a funny, mildly offensive computer design that will make you laugh out loud. Great for computer geeks. Funny Rectangle Magnet Add instant style to lockers, dorm rooms, workspace or the fridge while keeping your notes and reminders in view with an attention-grabbing Rectangle Magnet. Measures 2.125 x 3.125. Metal shell. Mylar/UV protecting cover.

Runtime Error 200


Runtime Error 200


$70.1


High Quality Content by WIKIPEDIA articles Runtime error 200 is the standard error message by Borlands Pascal compilers, standing for Division by zero. Many older computer programs for the MSDOS operating system fail immediately on loading with this error message. In many case they were compiled with an older version of the Borland or Turbo Pascal compiler, which often generated programs which failed if executed on computers with processors faster than about 200 MHz.Borland and Turbo Pascals standard libraries included a procedure called delay(n), code created for halting the execution of the program for a given number of milliseconds. Due to the initializing of the CRT unit, this procedure is called even if the software itself doesnt do it explicitly. Author: Surhone, Lambert M./ Timpledon, Miriam T./ Marseken, Susan F. Binding Type: Paperback Number of Pages: 84 Publication Date: 2010/07/16 Language: English Dimensions: 6.00 x 9.02 x 0.20 inches

: R Tape loading error Message White T-Shirt by CafePress


: R Tape loading error Message White T-Shirt by CafePress


$25


The site was inspired by this message. A legend in its own OS. The dreaded message is back, and this time it’s wearable. Brrrr-Beep. Message White T-Shirt Tee, TShirt, Shirt The white t-shirt is a timeless classic for a reason; it should be a staple in every wardrobe. It is clean, simple, and durable. The best part is you can wear it with anything. This 100% cotton T-shirt is so comfortable you’ll want to wear it to bed.

User Error  Funny Mug by CafePress


User Error Funny Mug by CafePress


$15


It’s a funny error message that you hope you never get on your computer. It says user error. Replace user. You’ve screwed it up somehow, and it’s all your fault. Great funny gift for computer geeks. Funny Mug The perfect size for your favorite morning beverage or late night brew. Large, easy-grip handle. Treat yourself or give as a gift to someone special. Measures 3.75 tall, 3 diameter. Dishwasher and microwave safe.


Tags: , , , , , , , ,

Write a comment:





Spam Protection by WP-SpamFree

The owner of this website Susie Mills is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking Nuke Modified | AntiVirus Remover to Amazon Properties including, but not limited to amazon.com, endless.com, smallparts.com, myhabit.com or amazonwireless.com