Im building a chat with php/mySQL but I dont want my database to be filled
up with messages upon messages, what I want to do is make it start deleting
rows after lets say 100 rows (which hold the messages)(each individual row
holds one chat message), is there a way of doing this through deleting
What is the proper syntax for storing an array in a session?
is it $_SESSION[BILLARRAY]=$ARRAY?
Randy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
What is the proper syntax for storing an array in a session?
is it $_SESSION[BILLARRAY]=$ARRAY?
Yep, providing youre using session_start() and session_register(_SESSION)
you can assign any type of data, just like a regular hash.
Todd.
- Original Message -
From: Randy Johnson [EMAIL
I was looking into stripping HTML files that contain alot of links. I
was trying to avoid the manual way of data entry. The contents i need
are the name of the link (plain text which sits out side the HTML code)
and all the a href tags. I would like the a href (ie.the hyperlink)
tags to be
Hi Philip,
There's definitely MySQL support in there, and I think FTP is enabled (FTP
Support: enabled).
What are the options for fonts in GD without freetype? The GD site doesn't
have any sample images... I assume it means you can't use TTF, and you can't
get anti-aliasing.
GD2 is in Beta,
Hi Charles,
Not sure exactly what you are after, but
function displayLinks ($pagecontents) {
$search = '/a (.*?)href=(.*?)(.*?)\/a/im';
$replace = 'a
$1href=recordstep.php?clientid=$clientidtestid=$testidlink=$2$3/a';
return (preg_replace ($search, $replace,
PHP and MYSQL Web Development manual by Welling and Thompson states
that logical operators are as follows:
___
Operator Name
Use
Result
___
!
Ok I looked at all the math functions for PHP but saw no way of returning the average
of a set of numbers - I plan on using this for a rating system - any help?
--
John
I made a php toolbar for Homesite v5. It's currently at v1.0 right now,
but I'm looking for any suggestions anyone might have for the next version.
http://zurnet.com/dl/hsphptb/
--
Matt Zur
[EMAIL PROTECTED]
http://www.zurnet.com
Need a Web Site??? - Visit... www.zurnet.com
1997 - 2002 -
Thanks for the help. I made the change as follows, as I don't mind it
be transient data... but I still get the string outputted on the web page. I
can parse the string all I want, but the following code still prints out the
annoying string on the webpage. Any ideas where I am going wrong? Stan
Try
curl_setopt($ch, CURL_NOBODY, 1);
Mike
Phplist [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Thanks for the help. I made the change as follows, as I don't mind it
be transient data... but I still get the string outputted on the web page.
I
can parse
just sum them up and divide by the count - making sure to deal with a count
of zero
-Original Message-
From: JohnP [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 10:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Average Number For Math Functions
Ok I looked at all the math
Ok so how do I sum up an entire column in my db?
For example if one row is : 1 , the next is 2, and the next is 1 - I need to
have a total of 4 and the be able to divide by the num_rows
The problem I ma having is the inside row addition
Martin Towell [EMAIL PROTECTED] wrote in message
[EMAIL
At 05:55 PM 8/29/02 , JohnP wrote:
Ok I looked at all the math functions for PHP but saw no way of returning
the average of a set of numbers - I plan on using this for a rating system
- any help?
--
John
Nope - you'll have to 'roll your own' by looping though the set, or (if you
have
$_SESSION is a predefined variable, session_start()
session_register('BILLARRAY') should work though :)
Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399
Try my open source PHP authentication system, Rampart by visiting
http://rampart.sourceforge.net/. Commercial support
Can't you just count the elements and then divide the total by the count?
It seems pretty obfuscating to consider a function that takes an unknown
number of elements, unless it were an array... still, seems pretty easy to
count and divide total... doesn't it?
-VolVE
- Original Message
if i remember 4th grade math class correctly...
?
$total = 0;
$count = 0;
// get each of the numbers
foreach($array_of_the_numbers as $key = $value)
{
$total += $array_of_the_numbers[$key];
++$count;
}
// wow, that's a toughie!
$average = $total / $count;
// then you could
I can't seem to see a pre-built functions but here is one I just wrote in
my email client:
function average($numberArray) {
$sum = 0;
for ($i=0;$icount($numberArray);$i++)
$sum += $numberArray[$i];
return $sum / count($numberArray);
}
echo average(array (1,2,3,4,5));
Hope
Im new to PHP (came from ASP). I'm trying to make pictures (.jpgs) come out
of a folder and display on a page. Here is my code so far:
?php
$fileLoc = Bid2002/pictures.txt;
$zFile = fopen($fileLoc, r);
$zContents = fread($zFile, filesize($fileLoc));
fclose($zFile);
echo a
if you have each filename on a new line, then use file() to grab the
contents. It returns an array, each line is an element in the array. You can
then do what you want with the array
HTH
Martin
-Original Message-
From: stu9820 [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002
Ok so how do I sum up an entire column in my db?
For example if one row is : 1 , the next is 2, and the next
is 1 - I need to
have a total of 4 and the be able to divide by the num_rows
The problem I ma having is the inside row addition
If you're doing it on values from a database
What database are you using?
MySQL has a SUM function which automatically selects the total of a column.
-VolVE
- Original Message -
From: JohnP [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 29, 2002 21:25
Subject: Re: [PHP] Average Number For Math Functions
Ok so
Very cool!
Here's a few suggestions:
cookie should open a dialog box so you can input
values similar to mail.
ability to enter more than one array value at once
maybe the dialog box has a drop down [1-10] which so
if you select 4 then 4 fields appear to enter more
values
mysql functions are
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
says...
At 06:03 29/8/2002 -0400, David T-G wrote:
Frank, et al --
..and then Frank said...
%
% Hi,
%
% when logging in with username and password with the good old Require
user
% mechanism in Apache I could earlier see
In article 01ae01c24f4f$51dc7bd0$b50a@web18, [EMAIL PROTECTED] says...
i want Y (year format) printed on my php script (looping), i already tried
it but i got same Year format (ex 1978) in all row in my table
my loop script is:
$query = (select * from table);
$result =
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] says...
Can anyone tell me why my emoticons arent appearing? Please?
Note: $message is a variable set by a web form. The field `pattern` is the
string to search for, like :-), and `url` is the relative url to the
emoticon. I just get the
I have sent an email using mail function in which the
subject and email body have charset=big5.
Customers with outlook express can read the big5
chinese characters without any trouble. However,
people who read their emails from Lotus Notes complain
that they cannot read the subject. But,
Hello,
On 08/30/2002 01:43 AM, Ellen O'Neal wrote:
I have sent an email using mail function in which the
subject and email body have charset=big5.
Customers with outlook express can read the big5
chinese characters without any trouble. However,
people who read their emails from Lotus
I can logout with session_unregister - but w00t about the back button?
This is probably so trivial that it has been discussed before, if anyone
has some knowledge or link at hand mind passing it on? Thanks.
- Victor www.argilent.com
I am still very new to PHP so things are still a little foreign to me - what
exactly is the SUM finction - I tried to locate one on both the PHP and
MySQL site but found nothing!
Thanks ~ John
Volve [EMAIL PROTECTED] wrote in message
Hi,
I'm trying to do a simple regexp to validate if a whole string only contains the
numbers 0 to 9, Letters a - f and A - F and the character :
Why isn't ereg([a-zA-Z0-9:],$string) working?
Guidance appreciated.
--
Adam Alkins
http://www.rasadam.com
--
I'm not sure if this will help but using mb_send_mail() instead of mail()
solved the problems I had with Japanese characters...
However, it might be the mail client itself. Check if they had no problem
before (when they received similar e-mails from other sources).
- E
I have sent an email
if you have a table called ratings and a field called score in it, then
doing this will show you the sum of all the scores:
select sum(score) from ratings;
eg, if the scores were 5, 2, 5, 8, and 2 then this sql should return 22
(unless I added it wrong... :/ )
-Original Message-
From:
Hi,
Friday, August 30, 2002, 3:10:09 PM, you wrote:
J I am still very new to PHP so things are still a little foreign to me - what
J exactly is the SUM finction - I tried to locate one on both the PHP and
J MySQL site but found nothing!
J Thanks ~ John
J Volve [EMAIL PROTECTED] wrote in
Hi,
you would be better off with preg_match, as its a little quicker apparently.
try:
preg_match(/^[:0-9a-f]*$/i,$string)
or change the * to a + to ensure $string is not null
the main problems you had:
- not ensuring that only those characters are found by using ^ and $
- not allowing
try this
ereg(^[a-zA-Z0-9:]*$,$string)
all your's is doing is looking for any char in $string that's a-z or A-Z or
0-9 or :
instead of all chars, from start to end, being them
-Original Message-
From: Adam Alkins [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 3:20 PM
To: PHP
I am still very new to PHP so things are still a little foreign to me -
what
exactly is the SUM finction - I tried to locate one on both the PHP and
MySQL site but found nothing!
http://www.mysql.com/doc/en/Group_by_functions.html#IDX1364
Well, it's close to "nothing" but if you study how
Interesting. It's not documented.
On Thu, 2002-08-29 at 14:44, Dallas Thunder wrote:
Well, this is exactly what function file() does.
David Christensen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
When PHP reads from a file using fgets(), does it do it
Or, is it? :)
http://www.php.net/manual/en/function.file.php
- E
Interesting. It's not documented.
On Thu, 2002-08-29 at 14:44, Dallas Thunder wrote:
Well, this is exactly what function file() does.
"David Christensen" [EMAIL PROTECTED] wrote in message
[EMAIL
Look at fgets and explode. Depending on the format of your txt file you can
use a combination of fgets and explode to get your desired results.
http://www.php.net/manual/en/function.fgets.php
http://www.php.net/manual/en/function.explode.php
If each picture name is on a separate line then the
Ok, file() is docuemted, but it doesn't say anything about whether or
not it reads data sequentially from top to bottom or if there's an
option to read bottom to top or anything in between.
Dave
On Thu, 2002-08-29 at 22:37, @ Edwin wrote:
Or, is it? :)
Dear All,
I'm using a shared server hosted by an ISP. I cannot get PHP recompiled
with --with-curl. I've read the information about cURL but it appears that I
need to be root in order to install it? I cannot do this. Does this mean
that I cannot use cURL or CURL at all? If it doesn't what do I
101 - 142 of 142 matches
Mail list logo