I'm getting input from a url like this: index.php?name=undark
I started off by inserting that value into a database, but now my problem is that I don't want to have duplicates in the database. I'm pretty much a newbie, and this is the only way I can think to do this. Either way, it's not working. Here's my code:
Any suggestions on how to get this to work?
I started off by inserting that value into a database, but now my problem is that I don't want to have duplicates in the database. I'm pretty much a newbie, and this is the only way I can think to do this. Either way, it's not working. Here's my code:
Code:
if ($name)
{
while ($row = mysql_fetch_array($result))
{
$test = $row['name'];
if ($name != $test)
{
$query = "INSERT INTO users VALUES ('$name','NULL')";
mysql_query($query) or die("Could not execute query");
}
}
}
Any suggestions on how to get this to work?