[PHP] Dumb Question - Casting

2010-02-18 Thread Chuck
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;

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Ashley Sheridan
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)

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Andrew Ballard
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

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Daniel Egeberg
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 =

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Joseph Thayne
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

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Nathan Rixham
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);

Re: [PHP] Dumb

2004-03-12 Thread PHP
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

Re: [PHP] Dumb

2004-03-12 Thread Burhan Khalid
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

[PHP] Dumb

2004-03-11 Thread PHP
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

RE: [PHP] Dumb

2004-03-11 Thread Jonathan Villa
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

Re: [PHP] Dumb

2004-03-11 Thread Evan Nemerson
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

[PHP] dumb time question

2003-01-13 Thread Pag
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

Re: [PHP] dumb time question

2003-01-13 Thread Tim Ward
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

[PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread Adam French
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)) {

Re: [PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread Tom Rogers
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

RE: [PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread Cesar Aracena
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

RE: [PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread Cesar Aracena
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

Re: [PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread Jason k Larson
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 =

RE: [PHP] DUMB QUESTION I'M SURE

2003-01-02 Thread rw
[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

[PHP] Dumb session cookie question?

2002-12-08 Thread Douglas Douglas
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

Re: [PHP] Dumb session cookie question?

2002-12-08 Thread Justin 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

Re: [PHP] Dumb session cookie question?

2002-12-08 Thread Robert Pruitt
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

[PHP] Dumb POST Array question

2002-11-25 Thread David Russell
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

Re: [PHP] Dumb POST Array question

2002-11-25 Thread Jason Wong
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

[PHP] Dumb Question

2002-08-31 Thread Gerard Samuel
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

Re: [PHP] Dumb Question

2002-08-31 Thread @ Edwin
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/

Re: [PHP] Dumb Question

2002-08-31 Thread Gerard Samuel
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:

Re: [PHP] Dumb Question

2002-08-31 Thread @ Edwin
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

Re: [PHP] Dumb Question

2002-08-31 Thread Michael Sims
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

Re: [PHP] Dumb Question

2002-08-31 Thread Gerard Samuel
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

[PHP] Dumb question

2002-08-21 Thread Liam MacKenzie
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

Re: [PHP] Dumb question

2002-08-21 Thread Bob Irwin
] 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

[Fwd: Re: [PHP] Dumb question]

2002-08-21 Thread David Christensen
() { 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

RE: [PHP] dumb

2002-07-10 Thread Brinkman, Theodore
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

[PHP] Dumb session / cookie / password questions

2002-07-10 Thread Chad Day
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

Re: [PHP] Dumb session / cookie / password questions

2002-07-10 Thread Richard Baskett
: 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

Re: [PHP] Dumb session / cookie / password questions

2002-07-10 Thread Martin Clifford
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

Re: [PHP] Dumb session / cookie / password questions

2002-07-10 Thread Alberto Serra
ðÒÉ×ÅÔ! 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

[PHP] dumb

2002-07-09 Thread Brendan P. Caulfield
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:

Re: [PHP] dumb

2002-07-09 Thread Kevin Stone
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

Re: [PHP] dumb

2002-07-09 Thread Juan Pablo Aqueveque
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.

Re: [PHP] dumb

2002-07-09 Thread Chris Shiflett
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

[PHP] dumb guy needs smart answer

2002-06-06 Thread Doug
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

Re: [PHP] dumb guy needs smart answer

2002-06-06 Thread Justin French
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

[PHP] Dumb question on terminology

2002-02-26 Thread Dean Householder
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

RE: [PHP] Dumb question on terminology

2002-02-26 Thread Martin Towell
, 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

[PHP] dumb mysql_connect issue

2001-07-31 Thread CGI GUY
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

Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread Alexander Wagner
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

Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread Philip Olson
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?

Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread mike cullerton
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,

Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread mike cullerton
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

Fwd: Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread CGI GUY
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

Re: Fwd: Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread Alexander Wagner
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

Re: Re: [PHP] dumb mysql_connect issue

2001-07-31 Thread Data Driven Design
, 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

[PHP] Dumb newbie graphics question

2001-03-01 Thread darthzeth
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

RE: [PHP] Dumb newbie graphics question

2001-03-01 Thread Jason Murray
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

Re: [PHP] Dumb newbie graphics question

2001-03-01 Thread Jack Dempsey
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

Re: [PHP] Dumb newbie graphics question

2001-03-01 Thread darthzeth
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

Re: [PHP] Dumb newbie graphics question

2001-03-01 Thread Simon Garner
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

RE: [PHP] Dumb newbie graphics question

2001-03-01 Thread John Ashton
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