![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| I have an online database that allows users to enter data. Is there a way I can verify that they do not enter a duplicate? I would have to check it with at least three fields. Date and Name and state Thanks for any information. | |||
|
| Advertisements |
| | #2 | ||
| "MeNotHome" <dtfa@****nospm****insightbb.com> wrote in message news:oobogvsiinn8pm44uiq2i8j7jhruvl3n8e@4ax.com... > I have an online database that allows users to enter data. > > Is there a way I can verify that they do not enter a duplicate? > I would have to check it with at least three fields. Date and Name > and state > > Thanks for any information. > > Do these users enter data directly into the database or via a form on a web page? If it's a form, use PHP to validate the fileds: if ($field01 = '' || $field02 == '' || $field03 == '') { echo "field01 and field02 and field03 have not been filled in..."; } else { // process form } | |||
|
| | #3 | ||
| $sql = "SELECT * from table WHERE date = '$date' and name = '$name' and state = '$state'"; if (mysql_num_rows($sql_query)==0) { insert } else { don't insert } "MeNotHome" <dtfa@****nospm****insightbb.com> wrote in message news:oobogvsiinn8pm44uiq2i8j7jhruvl3n8e@4ax.com... > I have an online database that allows users to enter data. > > Is there a way I can verify that they do not enter a duplicate? > I would have to check it with at least three fields. Date and Name > and state > > Thanks for any information. > > | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: checking, duplicates, during, insert, phpmysql |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you insert a Jpeg image into Mysql ??? | Andy Yeo | PHP | 5 | 07-01-2007 3:29 PM |
| How NOT to Insert Duplicate Records? | Antithesis | PHP | 2 | 07-01-2007 3:18 PM |
| Find out key from Insert Statement | Erland Sommarskog | PHP | 0 | 07-01-2007 3:17 PM |
| mysqlpp::insert query feature | Bjorn Nuyttens | Database | 2 | 06-26-2007 12:09 AM |
| Avoiding duplicates | Michael Ernst | Database | 1 | 06-10-2007 12:20 AM |
| Featured Websites | ||||
|