Hey, I've written a script in PHP that writes data into a MySQL database upon request, but what I'd also like to include is a script that will go in after the request is made, and check to make sure that the same entry does not already exist... and I have no clue where to start. I've never tried to do anything like this before, and am not sure what to do. If I could get some ideas from anyone it would be greatly appreciated. Thanks!

All you have to do is run a select statement looking for the value you just inserted. This goes right after your insert statement.

Here's some pseudo code:
 
1. insert into table(field1) values('value')
2. y = select count(field1) from table where field1 = 'value'
3. if (y == 1)
	  just one exists
   elseif( y > 1)
	  multiple exist

If you need more help let us know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.