Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.
Can someone explain why the second expression in this code snippet evaluates
to 7 and not 8?
$a = (int) (0.1 +0.7);
echo $a\n;
$x = (int) ((0.1 + 0.7) * 10);
echo $x\n;
$y = (int) (8);
echo $y\n;
On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote:
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.
Can someone explain why the second expression in this code snippet evaluates
to 7 and not 8?
$a = (int) (0.1 +0.7);
echo $a\n;
$x = (int) ((0.1 + 0.7)
On Thu, Feb 18, 2010 at 10:50 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote:
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.
Can someone explain why the second expression in this code snippet evaluates
On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com wrote:
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.
Can someone explain why the second expression in this code snippet evaluates
to 7 and not 8?
$a = (int) (0.1 +0.7);
echo $a\n;
$x =
According to the PHP manual using the same expression, Never cast an
unknown fraction to integer, as this can sometimes lead to unexpected
results. My guess is that since it is an expression of floating
points, that the result is not quite 8 (for whatever reason).
Therefore, it is rounded
Daniel Egeberg wrote:
On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com wrote:
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.
Can someone explain why the second expression in this code snippet evaluates
to 7 and not 8?
$a = (int) (0.1 +0.7);
program
with no real compile options.
- Original Message -
From: Jason Davidson [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 11:44 AM
Subject: Re: [PHP] Dumb
Not a dumb question at all. I suppose you could try forcefeeding the
php rpm into the system
PHP wrote:
Thanks, that is what I figured.
I really don't get rpm's, it seems you are stuck with whatever the packager
felt like putting in the rpm.
Want to add a library? Like zlib for example? then you have to re-compile it
yourself anyways.
They seem completely useless to me for anything but a
Hi,
I have a dum question.
I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and php4 are all
installed , via rpm I am assuming.
I upgraded mysql to version 4, however, php is still using the version 3 client. (from
php_info)
How do I get php4 to use the mysql4 client?
I
Go to rpmfind.net and see if you find one...
Or see if you uninstall all the mysql RPMs and use the ones from
mysql.com/downloads. They also have an RPM client.
-Original Message-
From: PHP [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 1:32 PM
To: php
Subject: [PHP
uninstall all the mysql RPMs and use the ones from
mysql.com/downloads. They also have an RPM client.
-Original Message-
From: PHP [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 1:32 PM
To: php
Subject: [PHP] Dumb
Hi,
I have a dum question.
I recently picked up a new
Ok, this is going to be laughable, but here goes. I am looking at code too
much to get this one:
Have 2 text fields on a database called hours and minutes.
How can i get the current time (hour-minutes) in two digit format and
apply it to the two variables? Everything i do only gets one
use the date() function, in this case date(i) and date(h) or date(H)
Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Pag [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 13, 2003 10:25 PM
Subject: [PHP] dumb time question
Ok
I'm just starting out, this is my script...
?
$name = $_POST['username'];
$name = $name;
$db = mysql_connect(localhost);
mysql_select_db(vinyldealers,$db);
$query = SELECT shops.name FROM shops WHERE name = .$name.;
$result = mysql_query($query);
while ($record = mysql_fetch_assoc($result)) {
Hi,
Friday, January 3, 2003, 4:18:05 PM, you wrote:
AF I'm just starting out, this is my script...
AF ?
AF $name = $_POST['username'];
AF $name = $name;
AF $db = mysql_connect(localhost);
AF mysql_select_db(vinyldealers,$db);
AF $query = SELECT shops.name FROM shops WHERE name = .$name.;
AF
PROTECTED]
Asunto: [PHP] DUMB QUESTION I'M SURE
I'm just starting out, this is my script...
?
$name = $_POST['username'];
$name = $name;
$db = mysql_connect(localhost);
mysql_select_db(vinyldealers,$db);
$query = SELECT shops.name FROM shops WHERE name = .$name.;
$result = mysql_query($query);
while
de enero de 2003 3:18
Para: [EMAIL PROTECTED]
Asunto: [PHP] DUMB QUESTION I'M SURE
I'm just starting out, this is my script...
?
$name = $_POST['username'];
$name = $name;
$db = mysql_connect(localhost);
mysql_select_db(vinyldealers,$db);
$query = SELECT shops.name FROM shops WHERE name = .$name
I think it's just the $query var not having the right number of quotes.
I added single quotes around the value.
?
$name = $_POST['username'];
$name = $name;
$db = mysql_connect(localhost);
mysql_select_db(vinyldealers,$db);
$query = SELECT shops.name FROM shops WHERE name = '.$name.';
$result =
[mailto:[EMAIL PROTECTED]]
### Enviado el: viernes, 03 de enero de 2003 3:18
### Para: [EMAIL PROTECTED]
### Asunto: [PHP] DUMB QUESTION I'M SURE
###
### I'm just starting out, this is my script...
###
### ?
### $name = $_POST['username'];
### $name = $name;
### $db = mysql_connect(localhost
Hi all.
I'm sorry about the dumb question, but I've just
expend two hours trying to find the damn cookie and I
couldn't :(
I've read that when you use sessions and configure the
php.ini with session.use_cookies = 1, your sessions
will always send cookies to the client (if the client
accept the
if you are allowing cookies on your browser, and the sessions are working
(as they appear to be), then there WILL be a cookie somewhere on your
browsing computer.
However, I think you're a little confused about what you'll find... you'll
just find a cookie named PHPSESSID, with a value of
IE traditionally puts cookies in a folder named Cookies.
Do a search for 'cookies' -- see what you come up with.
on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote:
Hi all.
I'm sorry about the dumb question, but I've just
expend two hours trying to find the damn cookie and I
Hi all,
I have a multiple select called Consultants[] In one page.
On the target page, how would I reference it? Would it be:
$_POST['Consultants'][0]
$_POST['Consultants'][1]
Etc
Or something else?
Thanks
David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250
On Monday 25 November 2002 16:48, David Russell wrote:
Hi all,
I have a multiple select called Consultants[] In one page.
On the target page, how would I reference it? Would it be:
$_POST['Consultants'][0]
$_POST['Consultants'][1]
If in doubt, print it out (TM):
print_r($_POST);
The
And I feel foolish asking...
What is meant by 'procedural code' ???
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
My "dumb" answer :)
Try Google. Type:
"procedural code"
You might want to check,
"object-oriented"
as well...
I'm sure, you'll find helpful explanations...
- E
And I feel foolish asking...
What is meant by 'procedural code' ???
--
Gerard Samuel
http://www.trini0.org:81/
Google didn't have much to offer.
But if I should also check 'object-oriented' then I believe it deals
with classes.
I thought it was something else.
Just trying to figure out if phpdoc is for me, which it seems like its
not :(
Thanks
@ Edwin wrote:
My "dumb" answer :)
Try Google. Type:
Google didn't have much to offer.
Sorry 'bout that. Actually, if you have an idea of what OO
("object-oriented") is, I think I can say that "procedural" is just the
opposite of it.
I tried Google myself and this came out on top:
"Writing Procedural Code in Non-Procedural SQL"
There's a
On Sat, 31 Aug 2002 14:04:11 -0400, you wrote:
And I feel foolish asking...
What is meant by 'procedural code' ???
It's the opposite of declarative code. Here's a page that briefly
explains the difference:
http://www.wdvl.com/Authoring/DB/SQL/BeginSQL/beginSQL2_1.html
and
Here is my stab at it. One person described it as the opposite of OO.
So something similar to -
?php
do_this() {
// do this code
}
do_that() {
// do that code
}
if (isset( $_GET['foo'] )) {
do_this();
} else {
do_that();
}
?
would be considered procedural code.
If Im wrong I
Hey guys, got a basic question for you...
?
function getvar()
{
$vari = bollocks;
}
getvar();
echo $vari;
?
How do I make that function return the variable?
Thanks,
Liam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
]
Sent: Thursday, August 22, 2002 1:27 PM
Subject: [PHP] Dumb question
Hey guys, got a basic question for you...
?
function getvar()
{
$vari = bollocks;
}
getvar();
echo $vari;
?
How do I make that function return the variable?
Thanks,
Liam
--
PHP General
()
{
global $vari;
$vari = bollocks;
}
getvar();
echo $vari;
?
Best Regards
Bob Irwin
Server Admin Web Programmer
Planet Netcom
- Original Message -
From: Liam MacKenzie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 22, 2002 1:27 PM
Subject: [PHP] Dumb
Doesn't work for those of us who are on the digest.
- Theo
-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 4:59 PM
To: Brendan P. Caulfield; PHP
Subject: Re: [PHP] dumb
Thank you brendan my point from the beginning. Outlook users
I am a little confused about storing stuff in cookies/sessions and how to
prevent spoofing of them.
A user logs in, his e-mail address or user id and password(md5'ed) is
checked against my database.
Assuming it matches, I then set a cookie with the users id + email.
What is to stop someone
: Chad Day [EMAIL PROTECTED]
Date: Wed, 10 Jul 2002 16:09:53 -0400
To: [EMAIL PROTECTED]
Subject: [PHP] Dumb session / cookie / password questions
I am a little confused about storing stuff in cookies/sessions and how to
prevent spoofing of them.
A user logs in, his e-mail address or user id
Firstly, you should ALWAYS use an encryption algorithm for passwords. For my site, I
used md5() and match with that. That way, even if someone does get a hold of the
encrypted password, it's not in their best interest (or maybe it is, if they're bored)
to crack it.
I haven't testing the
ðÒÉ×ÅÔ!
Martin Clifford wrote:
Firstly, you should ALWAYS use an encryption algorithm for passwords.
For my site, I used md5() and match with that.
That way, even if someone does get a hold of the encrypted password,
it's not in their best interest
(or maybe it is, if they're bored) to
this is dumb. can we just ignore this and move. we are all smart enough
to block his posts. let's just do it and quit wasting all of our time and
get back to doing what we do here.
respectfully,
-brendan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Thank you brendan my point from the beginning. Outlook users Message-Block
Sender. Takes you two seconds.
-Kevin
- Original Message -
From: Brendan P. Caulfield [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Tuesday, July 09, 2002 2:53 PM
Subject: [PHP] dumb
this is dumb. can
Brendan, you have my vote.
come on.. let's work.
--jp
At 22:53 09-07-2002, Brendan P. Caulfield wrote:
this is dumb. can we just ignore this and move. we are all smart enough
to block his posts. let's just do it and quit wasting all of our time and
get back to doing what we do here.
Brendan P. Caulfield wrote:
this is dumb. can we just ignore this and move. we are all smart enough
to block his posts. let's just do it and quit wasting all of our time and
get back to doing what we do here.
Actually, some of us don't check mail from this list until the evenings.
By the
I get the following error statement from a PHP insert I am trying at
http://www.solomonsporch.org/test.php
Warning: Failed opening
'http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4' for
inclusion (include_path='c:\php4\pear') in e:\solomonsporch.org\test.php on
line 12
I
It can't find the file you asked to include on line 12 of test.php.
Post the code and we may be able to pin-point it. The first half of the
error is to do with the default include path... in addition to the include
path you set with include(), there is a default that PHP also checks (in
your
Some arrays use the format:
$row-data
while some use:
$row['data']
What is the terminology of these types so I sound like I know what I'm talking about.
Also, when and how do each come about?
Dean
, February 27, 2002 11:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Dumb question on terminology
Some arrays use the format:
$row-data
while some use:
$row['data']
What is the terminology of these types so I sound like I know what I'm
talking about. Also, when and how do each come about?
Dean
Is there anything (add. parameters, etc.) that I'm
missing that would possibly explain why the following
code won't execute?
?php
$connection =
mysql_connect(hostname,username,password) or die
(Couldn't connect to server);
$db = mysql_select_db(database, $connection) or die
(Couldn't select
CGI GUY wrote:
Is there anything (add. parameters, etc.) that I'm
missing that would possibly explain why the following
code won't execute?
What does it say? Any errors?
Are any of your messages printed?
regards
Wagner
--
Madness takes its toll. Please have exact change.
--
PHP General
Try putting mysql_error() in your die statements so :
or die(mysql_error());
and see what it tells you.
Regards,
Philip
On Tue, 31 Jul 2001, CGI GUY wrote:
Is there anything (add. parameters, etc.) that I'm
missing that would possibly explain why the following
code won't execute?
or, echo $sql and copy/paste it into an sql client and see what it tells
you.
on 7/31/01 4:21 PM, Philip Olson at [EMAIL PROTECTED] wrote:
Try putting mysql_error() in your die statements so :
or die(mysql_error());
and see what it tells you.
Regards,
Philip
On Tue, 31 Jul 2001,
on 7/31/01 4:10 PM, CGI GUY at [EMAIL PROTECTED] wrote:
Is there anything (add. parameters, etc.) that I'm
missing that would possibly explain why the following
code won't execute?
snip
in FROM table_name.column_name1,table_name.column_name2
table_name.column_name1 is a column, but FROM
Okay, well I used the mysql_error() print-out, and it
returned something weird:
Access denied for user: 'username@hostname' to
database 'tablename'
This is incongruous because:
1. The uid/password set I am using has full
privileges.
2. *tablename* is not a database (the code I listed in
my
CGI GUY wrote:
Access denied for user: 'username@hostname' to
database 'tablename'
1. The uid/password set I am using has full
privileges.
2. *tablename* is not a database (the code I listed in
my previous email is syntactically identical to the
script)-- it's a table.
Why is this
, July 31, 2001 6:47 PM
Subject: Fwd: Re: [PHP] dumb mysql_connect issue
Okay, well I used the mysql_error() print-out, and it
returned something weird:
Access denied for user: 'username@hostname' to
database 'tablename'
This is incongruous because:
1. The uid/password set I am using
howdy,
im new at this, so sorry if this is a dumb question...
I want to make some dynamically generated buttons, but even when i copy the most basic
of graphics scripts i can find out there, they dont seem to be working. Does this mean
my ISP is not configured for displaying PHP generated
im new at this, so sorry if this is a dumb question...
I want to make some dynamically generated buttons, but even
when i copy the most basic of graphics scripts i can find out
there, they dont seem to be working. Does this mean my ISP is
not configured for displaying PHP generated
darthzeth wrote:
howdy,
im new at this, so sorry if this is a dumb question...
I want to make some dynamically generated buttons, but even when i copy the most
basic of graphics scripts i can find out there, they dont seem to be working. Does
this mean my ISP is not configured for
like i said, im a newbie... how do i run phpinfo() ? my almost exclusive
experience is with FTPing html pages and a few PHP scripts to the server,
other than that, i dont know much. is there any FAQ you can point me to with
answer to absolute newbie questions like these?
- Original Message
From: "darthzeth" [EMAIL PROTECTED]
like i said, im a newbie... how do i run phpinfo() ? my almost exclusive
experience is with FTPing html pages and a few PHP scripts to the server,
other than that, i dont know much. is there any FAQ you can point me to
with
answer to absolute newbie
PROTECTED]
The Data Source Network
http://www.thedatasource.net
-Original Message-
From: darthzeth [mailto:[EMAIL PROTECTED]]
Sent: March 2, 2001 12:37 AM
To: Jack Dempsey
Cc: PHP general mailing list
Subject: Re: [PHP] Dumb newbie graphics question
like i said, im a newbie... how
60 matches
Mail list logo