473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

variable shared by users

Hi,

Is there anyway to share a variable between many web users ?

I've got an array, updated by users's actions.
i do want this same array be available to all web users in their sessions.

This without putting the content of the array in DB or file.

I can not use shmop or sysvsem

Any idea ?
Jul 21 '05 #1
5 1513
>Is there anyway to share a variable between many web users ?

I've got an array, updated by users's actions.
i do want this same array be available to all web users in their sessions.

This without putting the content of the array in DB or file.

I can not use shmop or sysvsem

Any idea ?


This is generally what a database is used for. And a database or
file is about the only way you will get the functionality you want.

Gordon L. Burditt
Jul 21 '05 #2
otiteca wrote:
Hi,

Is there anyway to share a variable between many web users ?

I've got an array, updated by users's actions.
i do want this same array be available to all web users in their
sessions.

This without putting the content of the array in DB or file.

Why don't you want to use a DB or file?


Brian
Jul 21 '05 #3
JDS
On Thu, 21 Jul 2005 19:07:57 +0200, otiteca wrote:
This without putting the content of the array in DB or file.


serialize the array and put it in a database or file.

oops! You don't want to put it in a db or file. well why the hell not?

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 22 '05 #4
> Is there anyway to share a variable between many web users ?

I've got an array, updated by users's actions.
i do want this same array be available to all web users in their sessions.

This without putting the content of the array in DB or file.


What you want is a global site variable. I don't think PHP can do
that...

That would make it easy to create counters of various types, shout
boxes, and a lot of other things, but without the overhead of the db,
or file...

I guess the DB is your choice for now.

-- Evanescent Lurker --

Jul 22 '05 #5
NC
otiteca wrote:

I've got an array, updated by users's actions.
i do want this same array be available to all web users in their sessions.

This without putting the content of the array in DB or file.
I can not use shmop or sysvsem


Well, since you are being so restrictive, how about combining the
two methods? :) Configure a small RAM disk or a HEAP table in MySQL
and store your stuff in a file on that RAM disk or in a record
(perhaps the only one) in the HEAP table... No disk spinning will
be involved; the data will remain in memory and will be shareable
between as many users as you want...

Cheers,
NC

Jul 22 '05 #6

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

Similar topics

4
by: Dan Elliott | last post by:
Hello, Converting from a working C program to C++, I run into the following error: I have a header: (header.h) namespace shared{ ... struct X{ ...
4
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a...
3
by: ton | last post by:
Hi, I keep several variables in a statevalue like: Dim session As SessionState.HttpSessionState = System.Web.HttpContext.Current.Session session("connect") = " FKHFSF " I thought that these...
5
by: Manuel Arroba | last post by:
I had the idea that two users code are being run by two different instancies, so from the variable values point of view they are complete independent. I have an asp.net that calls a module...
15
by: joun | last post by:
Hi all, i want to create in my asp.net application a custom server variable, so i can retrieve later in other pages (even asp or perl) with request.servervariables("HTTP_mycustomvariable") ...
3
by: Tarren | last post by:
Hi: In Visual Basic is there the equivalent of a Session variable where I can store variables in memory while the executable is running? I have been coding ASP .NET for some time, but am new to...
12
by: Zeppelin | last post by:
Hi, I have to port from asp a script that adds an ip to a list in plain text or an array. I need not using a database or filesystem, it has to be stored in memory in order that giving us best...
5
by: Steve Mauldin | last post by:
Having weird things happening with my code. Two users on at the same time and data entered by one user is added into another users global variable. global variable data being stored in session...
3
by: GHawley | last post by:
I have a fairly large application with about 200 users that uses Session variables. It would seem that occasionally these variables are being referenced incorrectly to the extent that different...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.