I am new to PHP and databases, here is my PHP code:
<?php
$email = $_POST['Email'];
$tc = $_POST['TotalCash'];
$tr = $_POST['TotalReferalls'];
// Connects to your Database
mysql_connect("205.178.146.92", "user", "pass") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());
mysql_query("INSERT INTO UserInformation(Email, TotalCash, TotalReferalls) VALUES('$email', '$tc', '$tr')");
Print "Your table has been populated";
?>
and this works when I change $email and all of the variables to a set value, like $email = '[email protected]', $tc = 3, $tr = 4, but when I try to set it by calling a url (mysite.com/myphp.php?$email='[email protected]'&$tc=4&$tr=2) it does not work, please show a working way to set the parameters from the url.
Thanks in advance!