Re: [PHP] Unexpected values in an associative array

2007-08-08 Thread Ken Tozier
On Aug 8, 2007, at 12:43 AM, Robert Cummings wrote: On Tue, 2007-08-07 at 23:28 -0500, Richard Lynch wrote: On Tue, July 31, 2007 11:06 am, Instruct ICC wrote: What is $value and what is this supposed to do: case'integer':

[PHP] PDO lastInsertID always returns zero for MySQL tables

2007-08-05 Thread Ken Tozier
Hi In the past, I always used mysql_insert_id() and never had a problem, but now that I'm using PDO, I'm finding that it always returns zero. The tables are identical between the two methods but where mysql_insert_id works $pdo_connection-lastInsertID() doesn't. The PDO documentation

Re: [PHP] PDO lastInsertID always returns zero for MySQL tables [SOLVED]

2007-08-05 Thread Ken Tozier
Disregard. After more head scratching I found that I was branching to the 'insert' handler without calling this-db-query($query). On Aug 5, 2007, at 9:18 PM, Ken Tozier wrote: Hi In the past, I always used mysql_insert_id() and never had a problem, but now that I'm using PDO, I'm

Re: [PHP] function - action

2007-08-03 Thread Ken Tozier
On Aug 3, 2007, at 9:39 AM, Ken Tozier wrote: On Aug 3, 2007, at 2:38 AM, Ralph Kutschera wrote: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use

Re: [PHP] function - action

2007-08-03 Thread Ken Tozier
On Aug 3, 2007, at 2:38 AM, Ralph Kutschera wrote: Hallo! I'm working on a project, where we distinguish between functions and actions in design, although in PHP both are implemented as functions. Is there a chance that PHP can use the word action as function? E.g.: public function

[PHP] Does PDO prevent class functions from calling other class functions?

2007-08-02 Thread Ken Tozier
Hi I've been writing PHP classes for around two years now but all of a sudden, the things I used to do don't work any more. I have a class that implements utility functions for database calls using PDO and am finding that I can't call one utility function from within another. If each

Re: [PHP] Does PDO prevent class functions from calling other class functions?

2007-08-02 Thread Ken Tozier
which isn't particularly useful if it's PHP itself that is doing something unexpected http://www.php.net/manual/en/language.exceptions.php -nathan On 8/2/07, Ken Tozier [EMAIL PROTECTED] wrote: Hi I've been writing PHP classes for around two years now but all of a sudden, the things I

Re: [PHP] Does PDO prevent class functions from calling other class functions?

2007-08-02 Thread Ken Tozier
On Aug 2, 2007, at 12:19 PM, Nathan Nobbe wrote: On 8/2/07, Ken Tozier [EMAIL PROTECTED] wrote: How would I go about that? I just took a quick look at the try/catch documentation and it looks like it's my responsibility to throw exceptions which isn't particularly useful if it's PHP itself

Re: [PHP] Does PDO prevent class functions from calling other class functions?

2007-08-02 Thread Ken Tozier
On Aug 2, 2007, at 12:15 PM, Andrew Ballard wrote: Ken, Your method name is site_for_pub, and you are trying to call site_for_pub_id. I am indeed. What a bonehead. Thanks Andrew that fixed it. Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] PDO::ATTR_TIMEOUT script specific?

2007-08-02 Thread Ken Tozier
Hi I have a script that needs to get ad information from two different sources, a primary and fallback. The primary source is a high traffic (and poorly designed/unpartitioned MSSQL database) with millions of records that gets locked up when 'certain folks' (ie executives) perform large

Re: [PHP] Bizarre array create error

2007-07-31 Thread Ken Tozier
On Jul 31, 2007, at 2:00 AM, Richard Lynch wrote: On Sun, July 29, 2007 5:49 pm, Ken Tozier wrote: I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query

[PHP] Unexpected values in PHP array

2007-07-31 Thread Ken Tozier
Hi I think this is probably just a misunderstanding on my part, but I'm creating associative arrays with string keys from MySQL query results and when I put a value in the array, I get the expected key association along with an index key that has a different value. For example: If I have

[PHP] Unexpected values in an associative array

2007-07-31 Thread Ken Tozier
Hi I think this is probably just a misunderstanding on my part, but I'm creating associative arrays with string keys from MySQL query results and when I put a value in the array, I get the expected key association along with an index key that has a different value. For example: If I have

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier
) { if (!is_numeric($key)) { /* do stuff here */ } } Ken On Jul 31, 2007, at 10:35 AM, Ken Tozier wrote: Hi I think this is probably just a misunderstanding on my part, but I'm creating associative arrays with string keys from MySQL query results and when I put

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier
On Jul 31, 2007, at 11:40 AM, Robin Vickery wrote: Or don't get numeric keys in the first place: foreach ($this-db-query($query, PDO::FETCH_ASSOC) as $row) Robin: Bingo! That did the trick. I knew my solution was hokey but I haven't used PDO before this project so wasn't aware of what it

Re: [PHP] Unexpected values in an associative array

2007-07-31 Thread Ken Tozier
On Jul 31, 2007, at 12:06 PM, Instruct ICC wrote: array(6) { [task_id]= int(22) [0]= string(2) 22 [container_id]= int(3784) [1]= string(4) 3784 [name]= string(12) 108-6972.XTG [2]= string(24) 3130382D363937322E585447 } What is $coersions or $inQuery['coersions']?

Re: [PHP] Bizarre array create error

2007-07-30 Thread Ken Tozier
On Jul 30, 2007, at 2:23 AM, Paul Novitski wrote: At 7/29/2007 09:59 PM, Ken Tozier wrote: /*--*/ /* Next two lines are where the problem starts */ /* If I comment either of them out the script

[PHP] Bizarre array create error

2007-07-29 Thread Ken Tozier
Hi I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query with two dummy fields to be filled in later select *, 0 as dummy_1, 0 as dummy_2 from table

Re: [PHP] Bizarre array create error

2007-07-29 Thread Ken Tozier
On Jul 29, 2007, at 6:49 PM, Ken Tozier wrote: Hi I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query with two dummy fields to be filled in later

Re: [PHP] Bizarre array create error

2007-07-29 Thread Ken Tozier
On Jul 30, 2007, at 12:05 AM, Tom Ray [Lists] wrote: Ken Tozier wrote: Hi I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query with two dummy fields

[PHP] No is_date() function?

2007-07-25 Thread Ken Tozier
Hi I wrote a serialization function to turn arbitrary PHP variables into Macintosh plist compatible XML but see that there is no is_date tester as there is for bool, object, array etc. Is there a relatively simple (and robust) way to detect if a variable is a date? For example: $person =

Re: [PHP] No is_date() function?

2007-07-25 Thread Ken Tozier
Thanks Lars I saw that one already but unfortunately, it doesn't help as it requires 3 inputs . What I'm shooting for is an 'is_date' function that returns true or false with no prior knowledge of what a variable might contain. Ken On Jul 25, 2007, at 10:08 AM, Lars Haßler wrote: Hi,

Re: [PHP] No is_date() function?

2007-07-25 Thread Ken Tozier
On Jul 25, 2007, at 10:37 AM, Edward Kay wrote: PS: Please don't top post on mailing lists. I'm unfamiliar with the term top post. What does it mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] can't open a file

2007-07-22 Thread Ken Tozier
Hi I'm trying to create/open a file for write in a subfolder of the folder that contains my PHP script but am having no luck. Here's the relevant code $oldPath= '/test/old_page_'.$oldRecord['page_number'].'.txt'; $oldHand= fopen($oldPath,

[PHP] Accessing photos outside the web folder

2005-12-10 Thread Ken Tozier
I'm writing a content management application which saves file paths in a database and allows users to search the database for those files. Problem I'm having is that although the PHP script that handles the database queries works fine, when the search results get to the browser, all the

[PHP] Strange array access problem

2005-10-25 Thread Ken Tozier
I'm having a major problem with what seems, on it's face, to be a really basic array function. What happens is on the browser end, I've written some javascript code that packages up javascript variables in native PHP format and sends the packed variables to a PHP script on the server via a

Re: [PHP] Strange array access problem

2005-10-25 Thread Ken Tozier
Rob , Very helpful, Thanks! I'll try to rewrite the serializer on the javascript end to encode integer keys as integers. Ken On Oct 26, 2005, at 1:23 AM, Robert Cummings wrote: On Wed, 2005-10-26 at 01:06, Robert Cummings wrote: I did some more investigating. Your problem appears to

Re: [PHP] Strange array access problem

2005-10-25 Thread Ken Tozier
Got it working. Thanks for all your help Rob. Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Intelligent session_destroy()

2005-09-22 Thread Ken Tozier
I'm writing a bunch of scripts that will all use a common session and am a bit confused about when to manually destroy sessions and/or when php automatically destroys them for me. For example: If a user starts a session, leaves their computer on and goes home for the weekend, when they

[PHP] Using DOM object, how?

2005-09-19 Thread Ken Tozier
I was looking at the PHP DOM documentation here http://www.php.net/ manual/en/ref.dom.php (which is rather sparse in the way of examples) and can't even get to square one. Here's an example from the php site: ?php $doc = DOMDocument::loadXML('rootnode//root'); echo $doc-saveXML(); $doc =

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
The first line of that page - The DOM extension is the replacement for the DOM XML extension from PHP 4. makes me suspect that it may be a PHP 5 feature, and sure enough, a look in the changelog confirms this. php.net/ChangeLog-5.php#5.0.0b1 So if you are using php 5.0, that would explain

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
Next question: I don't see any obvious DOM method for including scripts or css links like script language='text/javascript' src='bobo.js'. Do you have to put them in some other type of node like a processing instruction or a comment? On Sep 19, 2005, at 5:22 AM, Ken Tozier wrote

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
I would be extremely careful with this.. because sadly PHP's XML generator uses the short form whenever possible. script / will *NOT* work in most browsers such as FireFox. script/script Will work. Thanks for the heads up. Looks like if you define the tag like $script=

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
Rats. Looks like you can't encapsulate DOM objects in your own classes. I tried this and the browser 'view source' shows a completely empty document. ?php $x = new MyDom(); $x-createScriptElement('howdy.js'); class MyDom { function MyDom() {

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
On Sep 19, 2005, at 3:26 PM, Vance Rodriguez wrote: I am used to seeing global class variables initialized in the class level if they are available to the class's $this statement. ?php $x = new MyDom(); $x-createScriptElement('howdy.js'); class MyDom { protected

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
Thanks Jasper Works perfectly on my Mac now as well. Ken On Sep 19, 2005, at 4:58 PM, Jasper Bryant-Greene wrote: ?php $x = new MyDom(); $x-createScriptElement('howdy.js'); print($x-saveXML()); class MyDom { private $dom; /* __construct() = PHP5 constructor */ function

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
); $this-appendChild($new_elem); return $new_elem; } } ? On Sep 19, 2005, at 6:13 PM, Ken Tozier wrote: Thanks Jasper Works perfectly on my Mac now as well. Ken On Sep 19, 2005, at 4:58 PM, Jasper Bryant-Greene wrote: ?php $x = new MyDom(); $x-createScriptElement('howdy.js

Re: [PHP] Re: Using DOM object, how?

2005-09-19 Thread Ken Tozier
On Sep 19, 2005, at 7:19 PM, Stephen Leaf wrote: On Monday 19 September 2005 06:04 pm, Ken Tozier wrote: Not a bad Idea. You might like this function I made then ;) function createElement($parentNode, $name, $elements=array()) { $node = $this-Dom-createElement($name

[PHP] Way for script to discover it's path?

2005-09-18 Thread Ken Tozier
I'm working on an auto-include mechanism for some complex scripts and rather than have all the paths to the various components hard coded, I'd like to have the script walk up the hierarchy looking for it's specified includes. Is it possible to do this? I looked at the various file related

Re: [PHP] Way for script to discover it's path?

2005-09-18 Thread Ken Tozier
['SCRIPT_FILENAME']; Good luck. Jordan On Sep 18, 2005, at 4:58 PM, Ken Tozier wrote: I'm working on an auto-include mechanism for some complex scripts and rather than have all the paths to the various components hard coded, I'd like to have the script walk up the hierarchy looking for it's

[PHP] short type codes for use in array conversion

2005-08-25 Thread Ken Tozier
I found a method for converting javascript arrays to PHP arrays here: http://aspn.activestate.com/ASPN/Cookbook/PHP/Recipe/414334; and would like to expand the list of types the function knows about. It looks like 's' = string, 'a' = array but 'i' for integer and 'n' for number don't work.

Re: [PHP] short type codes for use in array conversion

2005-08-25 Thread Ken Tozier
Thanks for the link Jasper. That solved it. Ken On Aug 26, 2005, at 1:22 AM, Jasper Bryant-Greene wrote: Ken Tozier wrote: I found a method for converting javascript arrays to PHP arrays here: http://aspn.activestate.com/ASPN/Cookbook/PHP/Recipe/ 414334 and would like to expand

[PHP] Using fonts in TrueType suitcases on a Mac?

2004-11-06 Thread Ken Tozier
I'm trying to use some of the truetype fonts on my mac with PHP's imagettfbbox() routine but since all my fonts are contained within suitcases, I don't know how to get them to work. I found one non-suitcase TrueType font that loads fine so I know the basic mechanism works and the script has

Re: [PHP] Re: Using fonts in TrueType suitcases on a Mac?

2004-11-06 Thread Ken Tozier
developing for a dual G4 running OS 10.3. Would this type of conversion work when put back on a Mac? Thanks, David Ken Tozier wrote: I'm trying to use some of the truetype fonts on my mac with PHP's imagettfbbox() routine but since all my fonts are contained within suitcases, I don't know how

[PHP] imagestring() not working

2004-11-01 Thread Ken Tozier
Hi all, I'm trying to create a little function that generates tabs dynamically and am having no luck with the imagestring() function. I checked out the documentation and even cut and pasted the example but it always chokes the browser when the page containing an imagestring() line is loaded.

[PHP] No luck creating dynamic images

2004-11-01 Thread Ken Tozier
I've been trying for most of the day to generate a simple dynamic image in my php script without any success. It seems obvious that something isn't right with my php environment as even the simplest images (like a rectangle) only yield the broken link icon. Does anyone know of any in depth

Re: [PHP] No luck creating dynamic images

2004-11-01 Thread Ken Tozier
snip Enable FULL error reporting. I tried this with error_reporting(E_ALL); and ran the script in multiple browsers no errors reported. Also ran phpinfo(); (as suggested by Jay Blanchard) which worked without problem. The settings under GD were all enabled for the common image types. Anybody

Re: [PHP] No luck creating dynamic images

2004-11-01 Thread Ken Tozier
to get the whole text in it. Check your server settings... Robert Ken Tozier is quoted as saying on 11/1/2004 2:51 PM: snip Enable FULL error reporting. I tried this with error_reporting(E_ALL); and ran the script in multiple browsers no errors reported. Also ran phpinfo(); (as suggested by Jay

[PHP] Using system resident fonts with image_xxx routines?

2004-11-01 Thread Ken Tozier
Is it possible to use fonts on a system with php's image routines? The GD supplied fonts look pretty crappy and if possible, I'd like to just use fonts available on the system (I'm on a Mac) rather than downloading a bunch of customized fonts exclusively for use with php's image_xxx routines.

[PHP] php command to open a url?

2004-10-31 Thread Ken Tozier
I've been looking around in the php documentation for a couple of hours now but can't seem to find any functions to open a url in the current browser window. Does php allow this? If so, could someone point me to a link? Basically what I'm trying to do is loop back in a login form until a user

[PHP] Form containing 2 menus not returning anything

2004-10-23 Thread Ken Tozier
I created an html form comprised of two menus but when the action method for the form calls my handler.php script, neither of the menu variables contain anything. Could someone point out what I'm doing wrong? Thanks, Ken Here's the relevant html: form

Re: [PHP] Form containing 2 menus not returning anything

2004-10-23 Thread Ken Tozier
Thanks John, that did the trick. I'm curious though, the PHP book I'm reading (PHP and PostgeSQL, Advanced web programming) specifically states that it's not necessary to grab form variables in this way, claiming PHP extracts all form variables behind the scenes for you. Was my original syntax

[PHP] Looping through results of pg_meta_data()

2004-10-22 Thread Ken Tozier
I'm trying to build an html table using the results from pg_meta_data() but none of the access functions seem to work. I am getting results but just can't seem to do anything with them. Here's what I'm using to verify that results are being returned: $connstring = dbname=pub_status

[PHP] Scripts not running on OS X 10.3

2003-11-01 Thread Ken Tozier
I can't get even the test script ?php phpinfo() ? to run on my Mac. I turned personal web sharing on, checked the httpd.config file (all is well) type 127.0.0.1/test.php in the browser and get a source view of the page (ie: ?php phpinfo() ? shows up in the browser winbdow). What am I doing

Re: [PHP] Scripts not running on OS X 10.3

2003-11-01 Thread Ken Tozier
I can't get even the test script ?php phpinfo() ? to run on my Mac. I turned personal web sharing on, checked the httpd.config file (all is well) type 127.0.0.1/test.php in the browser and get a source view of the page (ie: ?php phpinfo() ? shows up in the browser winbdow). What am I doing

Re: [PHP] Scripts not running on OS X 10.3

2003-11-01 Thread Ken Tozier
Ken Tozier wrote: I can't get even the test script ?php phpinfo() ? to run on my Mac. I turned personal web sharing on, checked the httpd.config file (all is well) type 127.0.0.1/test.php in the browser and get a source view of the page (ie: ?php phpinfo() ? shows up in the browser winbdow

Re: [PHP] Scripts not running on OS X 10.3

2003-11-01 Thread Ken Tozier
Odd. To be sure it's using the conf file you want, have you tried starting Apache with the command.? /path/to/httpd -f /path/to/httpd.conf I tried your suggestion but the system won't let me modify it even with su permissions. I'm too tired and frustrated to continue tonight. Clearly,