Re: [PHP] Associative array issues with loading values after initialization

2008-09-19 Thread Thomas Bolioli
I found the issue. The whitespace in between $list as $k => $V was all not truly whitespace. Gotta love BBEdit... Thomas Bolioli wrote: I hav ebeen able to track down that this is the part not working. It throws a parse error: PHP Parse error: syntax error, unexpected T_VARIABLE on the l

Re: [PHP] Associative array issues with loading values after initialization

2008-09-19 Thread Thomas Bolioli
(strcmp($selected_index, $k) == 0) { $select = ' SELECTED'; } else { $select = ''; } print "$v"; } } b wrote: Thomas Bolioli wrote: I should add, it is not working with this funciton, which could be the source of th

Re: [PHP] Associative array issues with loading values after initialization

2008-09-19 Thread Thomas Bolioli
; => 1, 'two' => 2, 'three' => 3, 'seventeen' => 17 ); foreach ($a as $k => $v) { echo "\$a[$k] => $v.\n"; } Thomas Bolioli wrote: I should add, it is not working with this funciton, which could be the source of the issue. fun

Re: [PHP] Associative array issues with loading values after initialization

2008-09-19 Thread Thomas Bolioli
ECTED'; } else { $select = ''; } print("".$nex[$k].""); } } Thomas Bolioli wrote: The below function is not working. function crm_get_country_list(){ global $dbh; $result = mysql_query("SELECT * FROM countries ORDER BY

[PHP] Associative array issues with loading values after initialization

2008-09-19 Thread Thomas Bolioli
The below function is not working. function crm_get_country_list(){ global $dbh; $result = mysql_query("SELECT * FROM countries ORDER BY pk_country_id ASC", $dbh) or die(mysql_error()); $country_list = array(' ' =>' '); while ($row = mysql_fetch_assoc($result)){ $country_list[$ro

[PHP] quick php for perl coder question

2008-09-11 Thread Thomas Bolioli
I want to return an array from a function. I have this: return array($found, $username, $email, $nickname); as my code. I have a bug in the code and I am not sure where yet. Should the above statement with this: array($vars); $vars = function($type, $abc, $xyz); $found = $vars[0]; $use

[PHP] direct access to file uploads

2003-06-18 Thread Thomas Bolioli
I am new to PHP and am trying to get access to files that are uploaded. I have RTFM ;-) and have noticed that PHP writes the file to disk in a temporary location and provides a method/class with all of the information needed to access it. I am loading (PDF's) into a binary field in mySQL and fi

[PHP] bcmod()

2003-06-17 Thread Thomas Bolioli
The docs (see below) for bcmod() are rather skimpy. Does anyone have a clue as to how it works. Basically I want to do this (below code). PS: I am new to PHP but not to programming in general. Tom $i = 1; while (something true){ $modulus = the_modulus_of($i / 4); // does php do % instead of

Re: [PHP] str_replace() problems actually *_replace() problems tobe

2003-06-16 Thread Thomas Bolioli
-) Thanks again, Tom Lars Torben Wilson wrote: On Mon, 2003-06-16 at 11:49, Thomas Bolioli wrote: I am a perl/java/c++ programmer who is doing something in php and have run accross something I am stumped with. I am trying to replace carriage returns with or tags (p's in groups of two and br&

[PHP] Re: Emptying the browser cache

2003-06-16 Thread Thomas Bolioli
There is no way to do this in any programming language since it is not part of the http spec. There may be som client side vb hack that someone knows that works on IE for Windows but I doubt it. It is not very secure to allow web sites to control your browser's cache. Try looking into expire ti

[PHP] str_replace() problems actually *_replace() problems to be more accurate

2003-06-16 Thread Thomas Bolioli
I am a perl/java/c++ programmer who is doing something in php and have run accross something I am stumped with. I am trying to replace carriage returns with or tags (p's in groups of two and br's for any unmatched cr's). I have tried all of the *_replace() functions including string_*, ereg_*