[PHP] sapdb and odbc_* binding

2002-04-08 Thread Charlie Killian
Is there anyway to bind variables using the odbc functions? Like what is done in the oci for Oracle. I'm trying to put long data into sapdb but sapdb complains because the queries are too long. This is due to the amount of data being inserted. Any workarounds? I'm using the latest sapdb and php

[PHP] Test for one bit set?

2002-04-07 Thread Charlie Killian
How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. TIA Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Test for one bit set?

2002-04-07 Thread Charlie Killian
Thanks to all those that replied. Especially Torben. (What have you been up to?) Miguel's solution works great. Check out the example below: ?php function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } for ($i = 0; $i 32769; ++$i) { if(isOneBitSet($i)) {

[PHP] Test for whole number.

2002-04-07 Thread Charlie Killian
Is there a one line test for whole numbers? I want to condense this function down to one line: function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } TIA, Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Test for whole number.

2002-04-07 Thread Charlie Killian
That post was incomprehensible. Here it is revised: I'd like to condense the function below into one line. function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } AND I don't want to do this: return (log($n)/log(2) == intval(log($n)/log(2))); So, is there a way to

[PHP] Re: Function that escapes special caracters from regular expressions

2002-04-07 Thread Charlie Killian
I don't now of one. Charlie Is there one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Variable Variables and Mulitdimensional Arrays

2002-03-15 Thread Charlie Killian
Hi. I want to be able to access a key in a multidimensional array at some depth n without knowing before runtime what the keys are. I thought this might be possible using variable variables. Here's some sample code using variable variables and multidimensional arrays: $y = 'a'; $z = 'b'; $t =

[PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE ?)

2002-03-15 Thread Charlie Killian
I have error's enabled in php.ini. I keep getting Undefined variable when I run a script that contains IF or ELSE IF's. Is this normal because the variable hasn't been set at the beginning of the script ? Yes. If the variable hasn't been defined previously you'll get a warning: if ( $dd 2)

[PHP] set_error_handler() not catching some errors

2002-02-09 Thread Charlie Killian
set_error_handler() is passing some errors like: $d = x; Use of undefined constant x - assumed 'x' But others like not including a semicolon returns nothing: $d = 3 The page is not returned there is no error and the page is stopped being parsed. Any ideas? My handler function: Function

Re: [PHP] set_error_handler() not catching some errors

2002-02-09 Thread Charlie Killian
Thanks Mike. I updated display_errors = On and now I see the errors. Charlie Sounds like you have your php.ini configured to not display errors, since you are not seeing the parse error message in your HTML output... -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] Math rounding problem

2002-02-08 Thread Charlie Killian
For an arbitrary large number I need to round() it up to the hundreds place if it is not divisible by 100 and leave it untouched if it is. So 1100 would round to 1100 and 1101 would round to 1200. Is there a clean way to do this? Currently I'm: $scale = round($scale+49, -2); // round up to

RE: [PHP] Math rounding problem

2002-02-08 Thread Charlie Killian
This equation from Bogdan is simple and working: $scale=ceil($scale/100)*100; Thanks to all those who helped, Charlie -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] $scale=ceil($scale/100)*100, maybe? Bogdan -- PHP General Mailing List

[PHP] register_globals not turning off

2001-12-13 Thread Charlie Killian
I turn register_globals off using this command: but my get variables are still accessible as variables. Any ideas. phpinfo() says: register_argc_argv Off register_globals Off PHP Version 4.0.6 Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

[PHP] Re: Generating variable names 'on the fly'

2001-09-20 Thread Charlie Killian
Neil, look under variable variables in the php manual. They're what you need: http://www.php.net/manual/en/language.variables.variable.php Charlie Neil Freeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, How do I generate variable names 'on the

[PHP] archives posting ip address not name

2001-09-20 Thread Charlie Killian
Why does the marc.aimsgroup archives post my IP address and not my name when posting to the newsgroup? Is there anyway I can change this? Charlie Killian [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

[PHP] Re: double values in array

2001-09-12 Thread Charlie Killian
Hi Tom. First check to see what $y looks like: print pre; print_r($y); print /pre; Then you'll see the whole array. I'm guessing your mysql_fetch_array() is returning the id twice. What does your query look like. Also, you can use the foreach but I don't think the while is the problem: $y =