Topic: PHP help
i realy suck at coding in php, so please dont used to many PHP terms, cuase i probebly wont understand what your trying to tell me.
I'm making a little database with php and mysql. I'm trying to check the input given from $post to make sure it doesnt excists in the DB yet. it should also check if its empty.
function insert_form2()
{
$HSoort = $_POST["HSoort"];
$query = "SELECT HSoort FROM hulpsoort WHERE HSoort ='$HSoort'";
$res = mysql_query ($query);
if (mysql_num_rows ($res) >= 1)
{
echo ("<center><font color='red'><Je Catergotie bestaat al! Kies a.u.b. een andere.</font><br><br></center>";
}
if (empty($HSoort))
{
echo ("<center><font color='red'><br>U heeft de nieuwe Catergorie geen naam gegeven.</font><br><br></center>");
}
$query = "INSERT INTO hulpsoort(
HSoort
)
VALUES(
'$_POST[HSoort'
)";
mysql_query($query);
echo ("
<center><font color='red'><b>Ingevoerd.<b></font><br>
<a href=\"./index.php\" target=\"_self\">Terug</a>
");
}i got asfar as this, but now i have no idea what going wrong.
dont worry about sql injection, cause only 3 people will use it, no acces from outside work







