madcrazy1 Posted September 3, 2007 Share Posted September 3, 2007 Hi, I am trying to control how many times a user can insert the same info I can control output using select distinct but if the user accidentally or intentionally repeatedly kept inserting the same info, that user would have to click the delete button that many times to get rid of it, istead of just once. this is the bit of code i tried adding if not exists to without any luck. ## ADD NEW ENTRY INTO THE DATABASE $query_add="INSERT INTO `files3` (`logid` , `name` , `bigimage` ) VALUES ('".$_SESSION['logid']."', '$l1', '$l2')"; $result=mysql_query($query_add); $_REQUEST['page'] = "links"; $ErrorMessage = "link updated successfully"; }break; Please help Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/67729-if-not-exists/ Share on other sites More sharing options...
teng84 Posted September 4, 2007 Share Posted September 4, 2007 what? explain more please Quote Link to comment https://forums.phpfreaks.com/topic/67729-if-not-exists/#findComment-340992 Share on other sites More sharing options...
Illusion Posted September 4, 2007 Share Posted September 4, 2007 Why do u allow user insert the same data multiple times? so u can use unique or primary key(s) on those column(s) where u dont want any duplicates values. Quote Link to comment https://forums.phpfreaks.com/topic/67729-if-not-exists/#findComment-341273 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.