•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,811 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,800 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2626 | Replies: 1
![]() |
•
•
Join Date: Jun 2004
Posts: 18
Reputation:
Rep Power: 0
Solved Threads: 0
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!
•
•
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation:
Rep Power: 12
Solved Threads: 4
All you have to do is run a select statement looking for the value you just inserted. This goes right after your insert statement.
If you need more help let us know.
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.
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- php drop down menu to search multiple sql tables (PHP)
- DDNS client: Multiple zone entries (Domains and DNS)
- Delphi - Database Entry Total (Pascal and Delphi)
- multiple select database (PHP)
- checking for Connect 4 (C++)
- "topantispyware" virus (Viruses, Spyware and other Nasties)
- need help phpbb please (PHP)
- force Search Page to return no records on open (ASP)
Other Threads in the PHP Forum
- Previous Thread: Reseller script
- Next Thread: making own webmail



Linear Mode