PHP Help: Display data from database based on login

Well what I have below is a basic query, I have a login for my site, but what I cant get it to do is return a query based on the user that is currently logged in. Any help for this? Thanks in advance

[php]<?php
$db=“ce1002”;
$user = ‘username’ ;
$link = mysql_connect(‘localhost’, ‘root’, ‘root’);
if (! $link)
die(“Couldn’t connect to MySQL”);
mysql_select_db($db , $link)
or die("Couldn’t open $db: ".mysql_error());
$result = mysql_query( "SELECT * FROM orders WHERE fullname = fullname " )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print “There are $num_rows orders.

”;
print “

\n”;
while ($get_info = mysql_fetch_row($result)){
print “\n”;
foreach ($get_info as $field)
print “\t\n”;
print “\n”;
}
print “
$field
\n”;
mysql_close($link);
?>
Welcome <?php if (isset($_SESSION['username'])) { echo $_SESSION['username']; } else { echo 'Not logged in'; } ?>!
[/php]

Kinda fixed this already, thanks!

I would like to be able to display headings. It currently only displays the rows but does not display the headings. Any ideas around it? Thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service