MySQL Forums
Forum List  »  PHP

Re: How to set Dynamic WHERE CONDITIONS to show customer rows depending on Login using PHP?
Posted by: Peter Brawley
Date: March 11, 2013 02:12PM

Before this page runs, save the customer ID in a $_SESSION[] variable.

For how to set up PHP sessions see Session setup under PHP/Basics at http://www.artfulsoftware.com/infotree/mysqltips.php.

Then this page can have code like ...

$custID=$SESSION["custID""];
$sql = "Customer_ID, Customer_FullName, OrderID, OrderDetails,submission_date, Customer_LoginID WHERE custID=$custID";

(note double quotes to enable variable substitution within the string).

Options: ReplyQuote


Subject
Written By
Posted
Re: How to set Dynamic WHERE CONDITIONS to show customer rows depending on Login using PHP?
March 11, 2013 02:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.