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 - 5t
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
H
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 pa
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 functio
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
[
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 v
$_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 i
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...
$value)
{
$total += $array_of_the_numbers[$key];
++$count;
}
// wow, that's a toughie!
$average = $total / $count;
// then you could make it pretty
$pretty_average = number_format($average, 1);
?>
booyah. :)
dave
-Origina
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;$i
To: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 1:55 AM
Subject: [PHP] Average Number For Math Functions
Ok I looked at all the math f
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:
$zContents";
?>
I dont have database support on the server i use (school server). I have all
the picture names in a text file and i want to pull out the nam
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 1:0
> 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 d
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
> O
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 qu
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
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
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, they
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 Lo
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
02d901c24fd5$aba46020$7800a8c0@idiom">news:02d901c24fd5$ab
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-
Fr
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 i
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 multip
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 ho
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
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 PROTEC
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 f
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? :)
>
> http://www.php.net/manual/en/func
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 ne
I see what you mean. But, personally, if the documentation didn't
explicitly say anything about it, I'd assume that it's from top to bottom
and that there's no option--of course, I could be wrong you know, there
must be something hidden...
- E
>
>Ok, file() is docuemted, but it doesn't say an
A.J.
It seems that you have exact same problem as me. Everything seems correctly
set up, the phpinfo shows;
curl
CURL support enabled
CURL Information libcurl 7.9 (OpenSSL 0.9.6b)
For the third day, I am trying to find out, but still I have not got any
useful information from the
101 - 138 of 138 matches
Mail list logo