Hello.
I am currently making my first website, and learning PHP as I go. I have encountered an error with a script that inputs data into a MySQL database, but I end up getting an error.
EDIT: Sorry about that. I made a stupid mistake, which I just noticed. Is there any way to delete this thread?
My code:
<?php
require('config.php');
mysql_connect($config['dbhost'],$config['dbuser'],$config['dbpass']);
@mysql_select_db($config['dbname']);
$table=$config['dbprefix'] . "posts";
$query="SELECT * FROM " . $table;
$result=mysql_query($query);
$num=mysql_numrows($result);
$title=$_GET['title'];
$postyear=date(Y);
$postmonth=date(m);
$postday=date(d);
$postdate=$postyear . "-" . $postmonth . "-" . $postday;
$authorurl="<deleted>/administrators.htm#" . $_GET['username'];
$author=$_GET['username'];
$body=$_GET['body'];
$addpostquery="INSERT INTO " . $table . " VALUES ('" . $num . "','" . $title . "','" . $postdate . "','" . $authorurl . "','" . $author "','" . $body . "')";
mysql_query($addpostquery);
mysql_close();
echo "Inserted.<br /><br />";
echo "<a href=\"<deleted>\">GO TO HOMEPAGE</a><br />";
echo "<a href=\"<deleted>/admin/home.php\">BACK TO ADMIN</a>";
?>
And the error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <DELETED URL> on line 17
Thank you.