php T_STRING problem
Posted by: rythmickason
Posted on: 2007-03-28 16:04:00
I am trying to do this tutorial: http://www.webmonkey.com/webmonkey/03/40/index0a.html?tw=programming
It is a simple tutorial on creating a blog using flash and mysql. I created a simple php file as per the instructions. Here it is:
<?php
mysql_pconnect ("yourHost", "yourUserName", "yourPassword");
mysql_select_db ("blog_db");
$qResult = mysql_query ("SELECT * FROM blog_entries ORDER BY id DESC");
$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;
for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($qResult);
$rString .="&id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&".
"&date".$i."=".$row['date']."&"."&entry".$i."=".$row['entry']."&";
}
echo $rString."&";
?>
I created using my host user and password information. I uploaded it to my http folder on the server.
This is the error I get:
Parse error: syntax error, unexpected T_STRING in /home/.metrik/kason/kason.info/http/flash_mysql.php on line 4
I am pretty new to php, so I don't really know what is wrong. Is this a dreamhost issue that I have to work around or is the code wrong? Thanks a bunch!!!