php query help

2 posts Page 1 of 1
Contributors
User avatar
Mark
VIP - Donator
VIP - Donator
Posts: 372
Joined: Mon Aug 17, 2009 10:35 pm

php query help
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
http://www.mbappz.com
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: php query help
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;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
2 posts Page 1 of 1
Return to “Help & Support”