Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
On Tue, 2008-08-12 at 23:23 -0500, Micah Gersten wrote: > Robert, when you do yours, it's performing the same function on two > different variable types and has to do a conversion before the function > works. He was doing a numeric function on a string which might be > giving the funky results. T

Re: [PHP] More math fun

2008-08-12 Thread Micah Gersten
Robert, when you do yours, it's performing the same function on two different variable types and has to do a conversion before the function works. He was doing a numeric function on a string which might be giving the funky results. Thank you, Micah Gersten onShore Networks Internal Developer http

Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
On Tue, 2008-08-12 at 14:59 -0700, Jim Lucas wrote: > Jay Blanchard wrote: > > abs($balanceTest) = 15.22 > > abs($oldLineArray[16]) = 15.22 > > > > $diff = abs($balanceTest) - abs($oldLineArray[16]); > > echo abs($diff) . "\n"; > > > > 1.7763568394E-15 > > > > WTF? This should be a big fat 0 > >

Re: [PHP] A dumb question regarding sending email

2008-08-12 Thread Chris
tedd wrote: Hi gang: I wish I had another identify for asking dumb questions, but it's late and I'm tried -- so here goes. I have a herdoc that I send out as an email -- no problems there. However, how do I include a link within it? If I use http://example.com, it's just a string but not an

[PHP] Re: A dumb question regarding sending email

2008-08-12 Thread Ross McKay
On Tue, 12 Aug 2008 22:07:41 -0400, tedd sperling wrote: >I have a herdoc that I send out as an email -- no problems there. > >However, how do I include a link within it? > >If I use http://example.com, it's just a string but not an actual link. > >So, how do you format a link in a heredoc? a) mo

[PHP] A dumb question regarding sending email

2008-08-12 Thread tedd
Hi gang: I wish I had another identify for asking dumb questions, but it's late and I'm tried -- so here goes. I have a herdoc that I send out as an email -- no problems there. However, how do I include a link within it? If I use http://example.com, it's just a string but not an actual link.

[PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Jon Drukman
Vinny Gullotta wrote: Well, what I need to be able to do is then take the numbers of each count and figure out which is used the most. We use this database to log actions taken on servers in our network. What my boss wants me to come up with is a list of which commands are issued the most, whic

Re: [PHP] More math fun

2008-08-12 Thread Jim Lucas
Jay Blanchard wrote: abs($balanceTest) = 15.22 abs($oldLineArray[16]) = 15.22 $diff = abs($balanceTest) - abs($oldLineArray[16]); echo abs($diff) . "\n"; 1.7763568394E-15 WTF? This should be a big fat 0 I do not see how it makes any difference if $balanceTest and $oldLineArray[16] are stri

RE: [PHP] If Column Exists

2008-08-12 Thread Jay Blanchard
[snip] I am working on data migration for one mysql db to another using PHP. How do I check if a particular table has a particular column. If not alter... [/snip] Use DESCRIBE TABLE; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strip_tags

2008-08-12 Thread Philip Thompson
On Aug 12, 2008, at 4:11 PM, Andrew Ballard wrote: On Tue, Aug 12, 2008 at 4:53 PM, Philip Thompson <[EMAIL PROTECTED] > wrote: On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote: On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson <[EMAIL PROTECTED] > wrote: Hi all. If you are sanitizing _PO

[PHP] If Column Exists

2008-08-12 Thread VamVan
Hello, I am working on data migration for one mysql db to another using PHP. How do I check if a particular table has a particular column. If not alter... Thanks

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Micah Gersten
Well, MySQL can aggregate the data for you so you don't have to pass it to PHP. It can just give you the results. I suggest reading up on the SELECT COUNT syntax and the GROUP BY syntax in MySQL. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullott

Re: [PHP] strip_tags

2008-08-12 Thread Andrew Ballard
On Tue, Aug 12, 2008 at 4:53 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote: > >> On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi all. >>> >>> If you are sanitizing _POST input for a database by escaping (

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Vinny Gullotta
Well, what I need to be able to do is then take the numbers of each count and figure out which is used the most. We use this database to log actions taken on servers in our network. What my boss wants me to come up with is a list of which commands are issued the most, which servers get the most

Re: [PHP] strip_tags

2008-08-12 Thread Philip Thompson
On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote: On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson <[EMAIL PROTECTED] > wrote: Hi all. If you are sanitizing _POST input for a database by escaping (via mysql_*), is there a reason to use strip_tags()? If so, why and could you provide an ex

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Micah Gersten
Why not let the DB do this for you? You can group by whatever column that is and select count(*), column_your_looking_for. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullotta wrote: > Nevermind, I figured it out. I needed to make the if statements

[PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Vinny Gullotta
Nevermind, I figured it out. I needed to make the if statements use == instead of = like this: if ($i[4] == "IISRESET") { $iiscount = $iiscount + 1; } etc. =) ""Vinny Gullotta"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] below is the output I'm seeing along with my code. The

[PHP] Incrementing variables based on database data

2008-08-12 Thread Vinny Gullotta
below is the output I'm seeing along with my code. There are 11425 items in the database, many of each of these possible values for $i[4], however you'll see from my Output that the $iiscount variable is the only one being incremented and it is getting incremented for every row in the table. Can

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[snip] string(5) "15.22" float(15.22) You're right*smacks forehead*. Sometimes this whole forest and trees thing kills me. [/snip] settype($balanceTest, "float") had no effect [/snip] $diff = round(abs($balanceTest), 2) - round(abs($oldLineArray[16]), 2); Works? Does round convert the strin

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[snip] Methinks you have different data types. [/snip] string(5) "15.22" float(15.22) You're right*smacks forehead*. Sometimes this whole forest and trees thing kills me. [/snip] settype($balanceTest, "float") had no effect -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[snip] Please provide the list with the following output: Methinks you have different data types. [/snip] string(5) "15.22" float(15.22) You're right*smacks forehead*. Sometimes this whole forest and trees thing kills me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
On Tue, 2008-08-12 at 15:18 -0500, Jay Blanchard wrote: > abs($balanceTest) = 15.22 > abs($oldLineArray[16]) = 15.22 > > $diff = abs($balanceTest) - abs($oldLineArray[16]); > echo abs($diff) . "\n"; > > 1.7763568394E-15 > > WTF? This should be a big fat 0 Please provide the list with the follow

[PHP] More math fun

2008-08-12 Thread Jay Blanchard
abs($balanceTest) = 15.22 abs($oldLineArray[16]) = 15.22 $diff = abs($balanceTest) - abs($oldLineArray[16]); echo abs($diff) . "\n"; 1.7763568394E-15 WTF? This should be a big fat 0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strip_tags

2008-08-12 Thread Richard Heyes
> Actually, yes, the data is likely to be redisplayed to the users on a > website. I covered that in my answer. Likely maybe; a certainty no. > However, when shoving the data to the browser, I use > htmlentities(). Is it recommended to use strip_tags() before sending to > htmlentities()? Not unl

Re: [PHP] strip_tags

2008-08-12 Thread Andrew Ballard
On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > Hi all. > > If you are sanitizing _POST input for a database by escaping (via mysql_*), > is there a reason to use strip_tags()? If so, why and could you provide an > example? > > Thanks, > ~Philip > The database won't c

Re: [PHP] strip_tags

2008-08-12 Thread Philip Thompson
On Aug 12, 2008, at 2:01 PM, Richard Heyes wrote: If you are sanitizing _POST input for a database by escaping (via mysql_*), is there a reason to use strip_tags()? If so, why and could you provide an example? Not really, as long as you're using something like mysql_real_escape_string(). T

Re: [PHP] strip_tags

2008-08-12 Thread Richard Heyes
> If you are sanitizing _POST input for a database by escaping (via mysql_*), > is there a reason to use strip_tags()? If so, why and could you provide an > example? Not really, as long as you're using something like mysql_real_escape_string(). Though if you're redisplaying it to your users (ie so

[PHP] strip_tags

2008-08-12 Thread Philip Thompson
Hi all. If you are sanitizing _POST input for a database by escaping (via mysql_*), is there a reason to use strip_tags()? If so, why and could you provide an example? Thanks, ~Philip "innerHTML is a string. The DOM is not a string, it's a hierarchal object structure. Shoving a string in