[solved. thanks]parse error ($_session[], select)
Posted: Tue Jul 03, 2007 10:17 am
Hi
this code is sending this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in g:\programs(2)\easyphp1-8\www\ha\previous\new folder\another\htdocs\myarticles.php on line 5
code:
this code is sending this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in g:\programs(2)\easyphp1-8\www\ha\previous\new folder\another\htdocs\myarticles.php on line 5
code:
Code: Select all
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("articles") or die(mysql_error());
$result = mysql_query("SELECT * FROM articles WHERE username=$_SESSION['username'] ORDER BY id") or die(mysql_error());
echo ?> <p align=center> your articles: </p> <?
while($row = mysql_fetch_array( $result )) {
echo $row['subject']."<br>".$row['title']."<br>".$row['text']."<br><br>";
}
mysql_close();
?>