Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page how do i prevent duplicate data in table
Reply
 
Thread Tools Display Modes
(#21 (permalink))
Old
Member
tttony is on a distinguished road
 
Posts: 84
Join Date: Nov 2008
Default 12-09-2008, 08:57 PM

Code Updated Ok....


Web developer PHP & MySQL

dominio gratis - free domain co.cc

Si te ayudé no te olvides del KARMA (Recuerda darme los puntos que quieras)
If I helped you don't forget KARMA (Remember give some points)
Reply With Quote
Sponsored Links
(#22 (permalink))
Old
Member
theModster is on a distinguished road
 
Posts: 44
Join Date: Dec 2008
Default 12-09-2008, 09:00 PM

i added your edit and when i register i get this error: Error no. 1136
Reply With Quote
(#23 (permalink))
Old
Member
tttony is on a distinguished road
 
Posts: 84
Join Date: Nov 2008
Default 12-09-2008, 09:05 PM

try with this.. and tell me...

PHP Code:
$conn mysql_connect("-----","-----","-----");

$db mysql_select_db("a3346318_users");

$username $_POST["username"];
$password $_POST["password"];
$email $_POST["email"];

$sql sprintf("INSERT INTO members2 (username, password, email) VALUES('%s','%s','%s')"$username$password$email);

$result = @mysql_query($sql);

if (
mysql_errno() == 1062

    echo 
"The user " $username " exist please try again with another username"

elseif(
mysql_errno() == 0

   echo 
"Thank you for registering " $username

else 

   echo 
"Error no. " mysql_errno() . " <br />Description: " mysql_error(); 



Web developer PHP & MySQL

dominio gratis - free domain co.cc

Si te ayudé no te olvides del KARMA (Recuerda darme los puntos que quieras)
If I helped you don't forget KARMA (Remember give some points)
Reply With Quote
(#24 (permalink))
Old
Member
theModster is on a distinguished road
 
Posts: 44
Join Date: Dec 2008
Default 12-09-2008, 09:22 PM

my brother you are a lifesaver! thank you man! its workin just how i wanted it 2 with my original 1/2 code i had originally lolz
Reply With Quote
(#25 (permalink))
Old
Member
tttony is on a distinguished road
 
Posts: 84
Join Date: Nov 2008
Default 12-09-2008, 09:55 PM

thats good and thanks for the karma


Web developer PHP & MySQL

dominio gratis - free domain co.cc

Si te ayudé no te olvides del KARMA (Recuerda darme los puntos que quieras)
If I helped you don't forget KARMA (Remember give some points)
Reply With Quote
(#26 (permalink))
Old
Member
theModster is on a distinguished road
 
Posts: 44
Join Date: Dec 2008
Thumbs up 12-10-2008, 01:19 PM

i added to your karma. Thanks alot
Reply With Quote
(#27 (permalink))
Old
Junior Member
shikha is on a distinguished road
 
Posts: 2
Join Date: Dec 2008
Default 12-17-2008, 06:03 AM

Hello Buddy

If you want to remove duplicasy from your table You just have to apply the primary and unique constraint

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com