Wednesday 31 August 2016

mysql - php syntax error, unexpected T_VARIABLE, expecting ',' or ';' on line 29

I'm trying to echo my information from my database in a simple blog.
Now it just won't work. Whatever I try.
I'm trying to figure it out myself but I am stuck behind a single error.




php syntax error, unexpected T_VARIABLE, expecting ',' or ';' on line 29



I just can't find a solution for it..
Hope you guys can help me. I am getting pretty insane of being stuck for hours here.



require('config.inc.php');
require('template.inc.php');
require('functions.inc.php');

$db_host = "***********";

$db_username = "************0";
$db_pass = "*********";
$db_name = "****************";

@mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
@mysql_select_db("$db_name") or die ("no database");

$title=$_POST['title'];
$contents=$_POST['contents'];
$author=$_POST['author'];

$date=$_POST['date'];
$date = strftime("%b %d, %y", strtotime($date));

$sqlcreate = mysql_query("INSERT INTO blog (date, title, contents, author)
VALUES(now(),'$title','$contents','$author')");
$query="SELECT * FROM tablename";
$result=mysql_query($query);
htmlOpenen('Voeg nieuwe post toe');
while ($result=mysql_query($query) ) {
echo'


'$result['title'];'


'$result['date'];'


'$result['contents'];'


'$result['author'];'


';
}
htmlSluiten();
mysql_close();

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...