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
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]
On Thursday 11 March 2004 11:38 am, Jonathan Villa wrote:
Go to rpmfind.net and see if you find one...
If not, try rpm.pbone.net. It seems like rpmfind's content has been lacking
lately, whereas pbone seems to have everything. rpmfind has a more powerful
search, though...
Or see if you
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, this is
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
Try by adding a backslash to the : there (...\: B...)
Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina
-Mensaje original-
De: Adam French [mailto:[EMAIL PROTECTED]]
Enviado el: viernes, 03 de enero de 2003 3:18
Para: [EMAIL
What they mean is to make that line:
$query = SELECT shops.name FROM shops WHERE name = $name;
Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina
-Mensaje original-
De: Adam French [mailto:[EMAIL PROTECTED]]
Enviado el: viernes, 03
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 =
Quoting Cesar Aracena [EMAIL PROTECTED]:
### Try by adding a backslash to the : there (...\: B...)
###
### Cesar L. Aracena
### [EMAIL PROTECTED]
### [EMAIL PROTECTED]
### (0299) 156-356688
### Neuquén (8300) Capital
### Argentina
###
###
### -Mensaje original-
### De: Adam French
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
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
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
You need to declare $vari as a global variable.
eg;
?
function getvar()
{
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]
---BeginMessage---
?
function getvar()
{
$vari = bollocks; # this $vari is local to function
}
$vari = getvar(); # this $vari is in global space
echo $vari
?
On Wed, 2002-08-21 at 20:35, Bob Irwin wrote:
You need to declare $vari as a global variable.
eg;
?
function getvar()
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
What I have done in the past is create a session variable that tells me that
the person using that session is valid. It's really really hard to spoof a
session variable. I did it this way after awhile since the original way
that I did it was by checking their username/password in the session on
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
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
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
In a nutshell:
$row-data is referring to an object, not an array, that has an attribute of
$data
$row['data'] is an associative array - ie, indexes are non-numerical - with
an index of data
Martin
-Original Message-
From: Dean Householder [mailto:[EMAIL PROTECTED]]
Sent: Wednesday,
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
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
46 matches
Mail list logo