473,729 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looping through session data

Hi all,

I'm using a database session handler and am looking to loop through
data residing in the sessions table to make a 'Users online' array.

I've found that using urldecode on the data column gives me a
serialized string of varname|datatyp e:data; for each variable. I'm
having a bit of trouble with deserializing the data.

I could always use regexps to grab the specific data I want, but I'm
sure there's a better way to do this. Any help is greatly appreciated.

Thanks much!
Jul 17 '05 #1
2 4000
ensnare wrote:
Hi all,

I’m using a database session handler and am looking to loop through
data residing in the sessions table to make a ’Users online’ array.

I’ve found that using urldecode on the data column gives me a
serialized string of varname|datatyp e:data; for each variable. I’m
having a bit of trouble with deserializing the data.

I could always use regexps to grab the specific data I want, but I’m sure there’s a better way to do this. Any help is greatly appreciated.
Thanks much!

PHP has a nice way of looping thru variables inside an array so with
query string you can do something like this:

foreach ($GET as $key => $value) {
//not do something with $value[$key]...
}

same for cookies, $_PUT, $_SERVER, etc.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Looping-...ict124156.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=413682
Jul 17 '05 #2
Hi ensnare,

On 28 Jun 2004 18:11:04 -0700, en*****@gmail.c om (ensnare) wrote:
Hi all,

I'm using a database session handler and am looking to loop through
data residing in the sessions table to make a 'Users online' array.

I've found that using urldecode on the data column gives me a
serialized string of varname|datatyp e:data; for each variable. I'm
having a bit of trouble with deserializing the data.


Have you tried unserialize()?

HTh, Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4060
by: kaptain kernel | last post by:
i've got a while loop thats iterating through a text file and pumping the contents into a database. the file is quite large (over 150mb). the looping causes my CPU load to race up to 100 per cent. Even if i remove the mysql insert query and just loop through the file , it still hits 100 per cent CPU. This has the knock on effect of slowing my script down so that mysql inserts are occuring every 1/2 second or so.
4
1867
by: Colin Steadman | last post by:
I've create a simple survey using ASP. Its finished and works, but one aspect of my coding is annoying me and I cant figure out a better way of doing it. Basically the questions are stored in an Access 2000 table like this: QUESTION_NUMBER QUESTION 1 Question 1 text.... 2 Question 2 text....
1
4492
by: Nicole | last post by:
Hello! I hope there is someone out there who can shed some light on this for me. I have a module that is supposed to look at an access table, pull out each bid record, link to another table to find all of the people to send the email to and link to one more table to find who should be cc'd on the note. All of this works fine, except.... The arrays for the To and CC seem to exclude names from the list if there are multiple recipients...
7
4861
by: Brian Conway | last post by:
Can anyone give me an example of how I can loop through a datagrid and have it run a stored procedure each time it loops?
5
2452
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
13
5024
by: JayCallas | last post by:
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up several questions / senarios: * I created several stored procedures that take parameters and inserts the data into the appropriate tables. This was done for easy access/use from client side apps (i.e. web-based).
8
3189
by: Steve Le Monnier | last post by:
Can anybody help with the following: I have some old VB6 code that loops through my inbox looking for emails with attachments and then save them to the hard drive. The code is very simplistic so I thought it would be dead easy to migrate it to C#, however it is proving more difficult than I first thought. The VB code is as follows: Set oSession = CreateObject("MAPI.Session") oSession.Logon("Outlook", , False)
5
2931
by: worldspy | last post by:
Hi guys, I don't know whether this is feasible or not. But here is my problem I have a session variable which has database field names in a particular order and this variable is generated dynamically, I dont know what is in that variable and in what order. What I have to do is display my results in the order they are in the session variable. So for example if my session varialbe contains session.sv =...
2
1552
nine72
by: nine72 | last post by:
Hi, first I want to say thanks for the help I received here over a year ago with a perplexing issue that I had. The advise was fantastic and helped a lot. Today I have another issues that I can not seam to get past or figure out and hope that the community here will be able to assist me in getting past this next mile stone in my current project. Overview… 8 forms all data being temp store in a mysql db. After they have filled in the...
0
8928
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9291
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9217
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4799
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2698
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.