[php]<?php
$Email = $_REQUEST[“CEmail”];
$Password = $_REQUEST[“CPassword”];
$Hostname = “fdb.awardspace.net”;
$DBName = “1946_accounts”;
$User = “1946_accounts”;
$PasswordP = “********”;
mysql_connect($Hostname, $User, $PasswordP) or die(“Can’t connect to DB”);
mysql_select_db($DBName) or die(“Can’t connect to DB”);
if(!$Email || !$Password){
echo"Empty";
}else{
$SQL = “SELECT * FROM accounts WHERE Email = '” . $Email . “’”;
$Result = @mysql_query($SQL) or die(“DB Error”);
$Total = mysql_num_rows($Result);
if($Total == 0){
$insert = “INSERT INTO accounts (‘Email’, ‘Password’, ‘Characters’) VALUES (’” . $Email . “’, MD5(’” . $Password . “’), 0)”;
$SQL1 = mysql_query($insert);
echo “Success”;
}else{
echo “AlreadyUsed”;
}
}
mysql_close();
?>[/php]
i have a c# script in unity, calling the url of the php script. when i direct connect to the php script it shows “empty” so it is making it that far into the script. when i try sending data to the db table from unity, it never makes it through and i never get errors back. I’m under the impression my else block is missing something.
could someone correct this code or help me out?