Ett stycke php-kod:
<?php
$kod = $_POST["kod"];
$namn = $_POST["namn"];
$id = $_POST["steamid"];
$isright = 0;
$con = mysql_connect("localhost","sourcemod","test123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sourcemod", $con);
if(mysql_num_rows(mysql_query("SELECT num FROM vip WHERE num = '$kod'"))){
$isright=1;
}
if ($isright == "1") {
mysql_query("INSERT INTO sm_admins (authtype, identity, password, flags, name, immunity, expirationdate)
VALUES ('steam', $id, ' ', 't', $namn, 1, ' ')");
echo "added to database";
echo $kod;
echo "<br>";
echo $id;
echo "<br>";
echo $namn;
echo "<br>";
echo $isright;
}
mysql_close($con)
?>
Allt funkar, förutom att inget händer i mysql databasen.
hjälp?
HareKrishnas gud sedan 2014