From: <cph...@us...> - 2006-03-14 07:54:24
|
Revision: 26 Author: cphillip Date: 2006-03-13 23:54:21 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/wnmap/?rev=26&view=rev Log Message: ----------- Add a check to ensure that a node with the supplied name doesn't already exist in the database. Modified Paths: -------------- trunk/web/AddPotentialNodeSubmit.php Modified: trunk/web/AddPotentialNodeSubmit.php =================================================================== --- trunk/web/AddPotentialNodeSubmit.php 2006-03-14 07:42:08 UTC (rev 25) +++ trunk/web/AddPotentialNodeSubmit.php 2006-03-14 07:54:21 UTC (rev 26) @@ -67,8 +67,16 @@ return; } +$query = "SELECT status FROM nodes WHERE nodeName='$nodename'"; +$result = mysql_query ($query, $connection) or die (mysql_error()); +if (mysql_num_rows($result) > 0) { + echo "A node with that name already exists in our database."; + return; +} + + $query = "INSERT INTO nodes ( status, adminHash, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |