[PHP] Re: Using and Echoing Session Variables

2004-07-19 Thread Jason Barnett
Ligaya Turmelle wrote: if they are all coming from the same query can't you assign them using the fetch_assoc? Sure! Ex: $data = mysql_fetch_assoc($result); $_SESSION['column1'] = $data['column1']; $_SESSION['column2'] = $data['column2']; $_SESSION['column3'] = $data['column3']; ... Or am I confuse

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Ligaya Turmelle
if they are all coming from the same query can't you assign them using the fetch_assoc? Ex: $data = mysql_fetch_assoc($result); $_SESSION['column1'] = $data['column1']; $_SESSION['column2'] = $data['column2']; $_SESSION['column3'] = $data['column3']; ... Or am I confused :) Respectfully, Ligaya T

Re: [PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Wong
On Sunday 18 July 2004 18:49, Harlequin wrote: > So If I needed say 10 session variables all based on field values in the > database I'd have to execute 10 separate queries and assign each variable > separately...? You don't *need* to perform 10 separate queries unless you *have* to. -- Jason W

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
My intention is: Include a file 1st line on file starts session Include another file, this will execute all the queries I need and set session variables. -- - Michael Mason Arras People www.arraspeople.co.uk - "Jason Barnett" <[EMAIL PR

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Jason Barnett wrote: Harlequin wrote: Jason Would there be anything wrong with using an include statement at the top of every page and the include page could then start a session, execute queries etc or would the session not start as it's not the first line in the page...? That's completely fine

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Harlequin wrote: Jason Would there be anything wrong with using an include statement at the top of every page and the include page could then start a session, execute queries etc or would the session not start as it's not the first line in the page...? That's completely fine. The main thing is, yo

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
Jason Would there be anything wrong with using an include statement at the top of every page and the include page could then start a session, execute queries etc or would the session not start as it's not the first line in the page...? -- - Michael Mason Arras Peopl

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Harlequin wrote: So If I needed say 10 session variables all based on field values in the database I'd have to execute 10 separate queries and assign each variable separately...? If that's the case then fine - as I only need do it once I know, but it does seem a rather long winded way of doing thin

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
So If I needed say 10 session variables all based on field values in the database I'd have to execute 10 separate queries and assign each variable separately...? If that's the case then fine - as I only need do it once I know, but it does seem a rather long winded way of doing things. -- ---

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Michael Purdy
Michael session_start() starts and resumes a session placing it in script that is being called will make the variable visible. Mike

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
Thanks very much Tularis :) -- - Michael Mason Arras People www.arraspeople.co.uk - "Tularis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you need to call session_start() on every page, yes. > Also, if you're bored with

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Harlequin wrote: OK, so here's my conundrum... After verifying the user and pulling all fields from the record I declare two variables (just testing here): $_SESSION['UserID'] = UserID; now contains the string / constant UserID $_SESSION['FurtherComments'] = FurtherComments; now contains the string

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
OK, so here's my conundrum... After verifying the user and pulling all fields from the record I declare two variables (just testing here): $_SESSION['UserID'] = UserID; $_SESSION['FurtherComments'] = FurtherComments; on the next page I start a session, everything OK. I echo the UserID variable -

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Harlequin
I've no problem declaring variables that way - used to it from VB anyway. Just wondered if there was a better way that's all. -- - Michael Mason Arras People www.arraspeople.co.uk - "Jason Barnett" <[EMAIL PROTECTED]> wrote in message

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Tularis
you need to call session_start() on every page, yes. Also, if you're bored with assigning values like that, and you're sure you're not overwriting anything, you could try: $_SESSION = array('UserId'=>'userid', 'Authorised'=>'yes','etc'=>'blah'); However, remember that you don't need to REassign v

[PHP] Re: Using and Echoing Session Variables

2004-07-18 Thread Jason Barnett
Harlequin wrote: Hi everyone. A few quick pointers if you have time... I've created a session, easy enough: I've created variables: $_SESSION['UserID'] = UserID; $_SESSION['Authorised']="yes"; $_SESSION['logname'] = $logname; When a user clicks a link to a test page I created the following doesn't