<?
include("config.php");
$id = $_GET['id'];
$username = $_GET['username'];
$type = $_GET['type'];
$result = mysql_query("INSERT INTO `logdb`.`devlogs` (`userid`, `username`, `type`, `timestamp`) VALUES ('" . $id . "', '" . $username . "', '" . type . "', '" . date("Y-m-d H:i:s") . "')");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
Trying with this URL but getting a blank page: mysite/devlog.php?userid=1&username=foo&type=join
Your problem is that your id field isn't being passed properly. Change your URL to contain id=1 instead of userid=1.
Also, you are very much so prone to MySQL injection with your query AND you are using the deprecated MySQL libraries, use PDO or MySQLi.
First point in $id variable, You wrote the $id = $_GET['id']; And when pass that through the url, You wrote it userid. You must make then the same.
Second point, You got a blank page because you did not return anything, Try the following
if (!$result) {
die('Invalid query: ' . mysql_error());
}else{
echo 'Everything is ok';
}
Third point, use mysqli instead of mysql.
Fourth point, Do you make this error intended and you want to catch error ?? in that case make an error in sql statement.