Skip to content

Instantly share code, notes, and snippets.

@alpham
Created November 20, 2012 20:59
Show Gist options
  • Save alpham/4121063 to your computer and use it in GitHub Desktop.
Save alpham/4121063 to your computer and use it in GitHub Desktop.
<?php
/*
* Created on Nov 20, 2012
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
echo "You entered id : ",$_POST["id"];
echo "<br /> and you want to add ",$_POST["points"]," points to this user .";
$con = mysql_connect("127.0.0.1","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$ahmed=mysql_select_db('test', $c);
if (!$ahmed)
{
die('error selecting DB :(' . mysql_error());
}
else
{
echo "selected :)";
}
#mysql_query("INSERT INTO fans VALUES ($_POST['id'], 'ahmed', $_POST['points'])",$c);
#echo "inserted :)";
#mysql_query("SELECT * FROM fans;",$c);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment