Date: 11/29/99
- Next message: Lars S. Geisler: "SV: SV: SV: RE: [PHPLIB] I can't keep the PHPLIB-"cookie""
- Previous message: hgfu <email protected>: "[PHPLIB] I.M. me when you get this"
- Next in thread: Stephen Bolinger: "RE: [PHPLIB] Problem with Sessions"
- Reply: Stephen Bolinger: "RE: [PHPLIB] Problem with Sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Here's the code I was referring to:
<?
page_open(array("sess" => "Example_Session"));
if (!isset($s)) { $s=0; };
$sess->register("s");
?>
<html>
<HEAD></HEAD>
<body>
<?
printf("<h1>Per Session Data: %s</h1>\n", ++$s);
?>
<?
$db = new DB_Test;
if ($token) {
$get_test_sql = "SELECT * FROM shows where token='$token'";
$db->query($get_test_sql);
$db->next_record();
$test_id = $db->f("test_id");
$test_name = $db->f("test_name");
$details = $db->f("details");
$expiration = $db->f("expiration");
$date_created = $db->f("date_created");
$test_zip = $db->f("test_zip");
?>
<H2>Production: <? echo $show_name ?></H2>
<? printf("<a
href=\"edit_notice.php3?selectnotice=%s&token=%s\">edit</a>\n", $show_id,
$token); ?>
<? printf("<a
href=\"edit_notice.php3?deletenotice=%s&token=%s\">delete</a>\n",
$show_id,$token); ?>
<? printf("<a href=\"add_notice.php3?show_id=%s&token=%s\">add
role</a>\n\n<BR>", $show_id,$token); ?>
Date Posted: <? echo $date_created ?><BR>
Zip code: <? echo $test_zip ?><BR>
Details: <? echo $details ?><BR>
<HR WIDTH="90%">
<?
$list_test_sql = "SELECT * FROM roles where show_id='$show_id' order by
test_name";
$db->query($list_test_sql);
while ($db->next_record()) {
?>
<B><? $db->p("test_name") ?></B> <? printf("<a
href=\"edit_role.php3?token=%s&selectrole=%s\">edit</a><BR>\n\n",
$token,$db->f("test_id")); ?>
Sex: <? $db->p("sex") ?><BR>
Age range: between <? $db->p("age_low") ?> and <? $db->p("age_high") ?>
years old.<BR>
Description: <? $db->p("description") ?><BR><BR>
<?
}
} else {
$list_test_sql = "SELECT * FROM shows order by date_created";
$db->query($list_test_sql);
while ($db->next_record()) {
?>
<BR><B><A HREF="<? echo $PHP_SELF ?>?token=<? $db->p("token") ?>"><?
$db->p("test_name") ?></A></B><BR>
Date Posted: <? $db->p("date_created") ?><BR>
Details: <? $db->p("details") ?><BR>
<?
}
}
?>
</BODY>
</HTML>
<?
page_close()
?>
The database connectivity works without a hitch, but the session variable
"s" doesn't increment. When I comment out the database interaction, the
session variable "s" does increment. Any ideas?
-Stephen Bolinger
-----Original Message-----
From: udall <email protected> [mailto:udall <email protected>]On Behalf
Of JOsh
Sent: Monday, November 29, 1999 2:01 PM
To: Stephen Bolinger
Subject: Re: [PHPLIB] Problem with Sessions
I'm a beginner at this as well. Would you be willing to share your example
code? I'd just like something to get me going with mysql ans sessions.
Thanks.
JOsh
Stephen Bolinger wrote:
> Hi. I'm trying to integrate session management into my site. I got
PHPLIB,
> installed it and got the demo working fine.
>
> I am using PHPLIB's database abstraction to interact with a MySQL
database.
> Here's where I've run into trouble:
>
> I took the PHPLIB sample index.php3 and added some database connectivity
to
> it. It displays everything properly out of the database, but the "s"
> variable does not increment. I've narrowed it down to the "$db->query"
> method.
>
> If I leave in the creation of the $db object but comment out the
$db->query,
> the "s" variable increments. As soon as I put the query back in, the
number
> stays the same. Any ideas?
>
> -Stephen Bolinger
>
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Lars S. Geisler: "SV: SV: SV: RE: [PHPLIB] I can't keep the PHPLIB-"cookie""
- Previous message: hgfu <email protected>: "[PHPLIB] I.M. me when you get this"
- Next in thread: Stephen Bolinger: "RE: [PHPLIB] Problem with Sessions"
- Reply: Stephen Bolinger: "RE: [PHPLIB] Problem with Sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

