Page 1 of 1

php query help

Posted: Mon Apr 25, 2016 9:44 am
by Mark
Hello,

I use this code to display all my records in my database
Code: Select all
$result = mysql_query("SELECT * FROM customers WHERE late = 'N' ", $sql);
this is how i display the username in of who is creating the new order.
Code: Select all
<input type="hidden" name="OrderBy" value=" <?php echo $username; ?>" disabled />
I was wondering if you can show me how to display the records that i only put in to the database not the records from other users.

Thanks

Mark

Re: php query help

Posted: Tue Apr 26, 2016 8:18 am
by CodenStuff
You could alter your query..example:
Code: Select all
$result = mysql_query("SELECT * FROM customers WHERE late = 'N' AND username = yourusername", $sql);
That would get all results just for that user.

Or use an IF maybe
Code: Select all
if($username == "mark")
{
   display your output here
}
That is if I understand your needs correctly lol :duh;