PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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());?> <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();
?>
but the output is:
Unknown column 'm2babaey' in 'where clause'
I have checked the spelling and have not found a mistake. it's so strange
has no single quotes, so it's comparing the 'username' column against the 'm2babaey' column, which as you could tell, does not exist. If you want to check against the value, enclose it in quotes so it reads it as the string value.