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
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
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
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
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
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
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
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
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.
--
---
Michael
session_start() starts and resumes a session placing it in script that is being called
will make
the variable visible.
Mike
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
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
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 -
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
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
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
16 matches
Mail list logo