destrugter
08-02-2007, 10:45 PM
ok, i am makking it to where people can put in stuff such as guides, for runescape, and it is sort of like a forum but not really, i am on my last part and i have an error in my code somehwere...can anyone tell me what i did wrong please? this is the code that inserts the stuff into the db...
<?php
$con = mysql_connect("mysql","cheese","pizza");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("cheese", $con);
mysql_query("INSERT INTO SkillGuides (`$_COOKIE["username"]`,`title`,`skill`,`p&f`,`guide`)
(\''.mysql_escape_string($_COOKIE["username"]).'\',\''.mysql_escape_string($_POST['title']).'\',\''.mysql_escape_string($_POST['skill']).'\',\''.mysql_escape_string($_POST['p&f']).'\',\''.mysql_escape_string($_POST['guide']).'\')';
mysql_close($con);
?>
can you please tell me what i did wrong?
<?php
$con = mysql_connect("mysql","cheese","pizza");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("cheese", $con);
mysql_query("INSERT INTO SkillGuides (`$_COOKIE["username"]`,`title`,`skill`,`p&f`,`guide`)
(\''.mysql_escape_string($_COOKIE["username"]).'\',\''.mysql_escape_string($_POST['title']).'\',\''.mysql_escape_string($_POST['skill']).'\',\''.mysql_escape_string($_POST['p&f']).'\',\''.mysql_escape_string($_POST['guide']).'\')';
mysql_close($con);
?>
can you please tell me what i did wrong?