Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread David Krings
csnyder wrote: On 7/24/07, Jon Baer <[EMAIL PROTECTED]> wrote: All that is really needed is a preserve_key to be added to array_splice function and you pretty much have it ... - Jon Indeed. When I saw your post I got all excited about doing something like: array_splice( $set, 3, 1, array('le

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
On 7/24/07, David Krings <[EMAIL PROTECTED]> wrote: I looked at that splice function a bit more and at arrays as well. I still don't get why the position matters. To me the key of an array is like the autoincrement primary key on a table. You can't just start messing around with it and expect ev

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
On 7/24/07, Jon Baer <[EMAIL PROTECTED]> wrote: All that is really needed is a preserve_key to be added to array_splice function and you pretty much have it ... - Jon Indeed. When I saw your post I got all excited about doing something like: array_splice( $set, 3, 1, array('legume'=>'chickpea

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
On 7/24/07, Rob Marscher <[EMAIL PROTECTED]> wrote: On Jul 24, 2007, at 1:29 PM, csnyder wrote: > Oh well. I think I'll have to create a map and use that to keep the > array in order: > > $set = array( 'vegetable'=>'tomato', 'fruit'=>'tomato', > 'bean'=>'chickpea', 'grain'=>'corn' ); > $map = arr

RE: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Anthony Wlodarski
Tom, Definitely can, I re broke it and the HTML is as follows from IE's source function. Now I also noticed that I had a top most nested tags that were not correct so I fixed them all but this is the HTML output from the non working version. I wonder if a top level tag will corrupt any other s

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread Jon Baer
All that is really needed is a preserve_key to be added to array_splice function and you pretty much have it ... - Jon On Jul 24, 2007, at 2:01 PM, Rob Marscher wrote: On Jul 24, 2007, at 1:29 PM, csnyder wrote: Oh well. I think I'll have to create a map and use that to keep the array in or

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread Rob Marscher
On Jul 24, 2007, at 1:29 PM, csnyder wrote: Oh well. I think I'll have to create a map and use that to keep the array in order: $set = array( 'vegetable'=>'tomato', 'fruit'=>'tomato', 'bean'=>'chickpea', 'grain'=>'corn' ); $map = array_keys( $set ); $map['bean'] = 'legume'; $set['legume'] = $set

RE: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Anthony Wlodarski
Rob, Thank you so much for the help. Cleaned up the tags, works like a charm now. Thanks, Anthony Wlodarski Technical Recruiter Shulman Fleming & Partners 646-285-0500 x230 [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rolan Yang

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
On 7/24/07, Ben Sgro (ProjectSkyLine) <[EMAIL PROTECTED]> wrote: Great question... I just spent some time to figure it out and came up with a cool way! 'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea', 'grain'=>'corn' ); $set = array_flip($set); $set['chickpea'] = 'legume'; $set = array_

Re: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Rolan Yang
Rob Marscher wrote: It looks like the problem is that you're not closing the form properly: echo "\n"; not echo "\n"; So the browser is probably getting confused on where to send the form submission. -Rob Good eye on that one. ~Rolan ___

Re: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Rob Marscher
It looks like the problem is that you're not closing the form properly: echo "\n"; not echo "\n"; So the browser is probably getting confused on where to send the form submission. -Rob ___ New York PHP Community Tal

Re: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Tom Sartain
Could you provide the HTML from the initial setup (the one that was broken)? I'm curious about what was output to the browser (since that's what dictates where the form is sent anyway) Thanks On 7/24/07, Anthony Wlodarski <[EMAIL PROTECTED]> wrote: Donald, Thanks for the recommendation, I tri

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread David Krings
csnyder wrote: What you can do is first identify the key/value pair you want to change. Then read out the value, then use unset($array['key']), then add the saved value to the array with the desired key name. The trick is that your new key=>value pair will be at the end of the array, not the th

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
On 7/24/07, David Krings <[EMAIL PROTECTED]> wrote: csnyder wrote: > Anyone know of an easy way to rename an associative array key in place? > > array( 'vegetable'=>'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea', > 'grain'=>'corn' ) > > I want the third element to be 'legume'=>'chickpea', but

RE: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Anthony Wlodarski
Donald, Thanks for the recommendation, I tried it and it did not work. I even looked up one level to the function that calls this function and I couldn't trace back and incorrect code. I moved the code out of the function and put it in its own php file: \n"; echo "\n";

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread Ben Sgro \(ProjectSkyLine\)
Great question... I just spent some time to figure it out and came up with a cool way! check it out! [EMAIL PROTECTED] fakie]$ cat test.php $set = array( 'vegetable'=>'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea', 'grain'=>'corn' ); $set = array_flip($set); $set['chickpea'] = 'legume

Re: [nyphp-talk] Rename an array key?

2007-07-24 Thread David Krings
csnyder wrote: Anyone know of an easy way to rename an associative array key in place? array( 'vegetable'=>'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea', 'grain'=>'corn' ) I want the third element to be 'legume'=>'chickpea', but it seems to involve rebuilding the array...? What you can do

[nyphp-talk] Rename an array key?

2007-07-24 Thread csnyder
Anyone know of an easy way to rename an associative array key in place? array( 'vegetable'=>'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea', 'grain'=>'corn' ) I want the third element to be 'legume'=>'chickpea', but it seems to involve rebuilding the array...? -- Chris Snyder http://chxo.com/

Re: [nyphp-talk] SQL question

2007-07-24 Thread Rob Marscher
OK... I actually looked in the manual this time to get some clarification - http://dev.mysql.com/doc/refman/5.0/en/join.html: "INNER JOIN and , (comma) are semantically equivalent in the absence of a join condition: both produce a Cartesian product between the specified tables (that is, ea

Re: [nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Donald Organ
try turning echo "\n"; into echo "\n"; On Tue, 2007-07-24 at 11:08 -0400, Anthony Wlodarski wrote: > Hello all, > > I am currently contracted by my boss to create a candide/company tracking > system in PHP/MySQL and have hit a little snag. > > Here is the code: > > function dis

[nyphp-talk] Having problems with PHP or maybe something bigger...

2007-07-24 Thread Anthony Wlodarski
Hello all, I am currently contracted by my boss to create a candide/company tracking system in PHP/MySQL and have hit a little snag. Here is the code: function displayCandidates($managerid) { $sqlcandidates = "SELECT * FROM `candidate` WHERE `managerid` = ".$managerid.""; $resu

Re: [OT] Re: [nyphp-talk] Oh... Interviewing LOLCats

2007-07-24 Thread csnyder
On 7/24/07, inforequest <[EMAIL PROTECTED]> wrote: Im noisin' ur talk list, fur-gettin me mannerz Oh jeez, do not want! I was just trying to lighten that interviewing thread, not dos the list with lolcats. ___ New York PHP Community Talk Mailing List

Re: [nyphp-talk] SQL question

2007-07-24 Thread Adrian Noland
On 7/23/07, Rob Marscher <[EMAIL PROTECTED]> wrote: If you did an INNER JOIN: SELECT u.id, s.id FROM user u INNER JOIN session s ON u.id = s.user_id WHERE u.id = 5 ... We had a discussion last year on NYPHP-MySQL about INNER JOIN versus commas (cartesian join) -- you so often see it with

Re: [nyphp-talk] open source project for dating site

2007-07-24 Thread Ben Sgro \(ProjectSkyLine\)
Hello, I believe it was CAKE PHP or one of the framework sites that had a tutorial, "build a dating site in 60 hours" or something. - Ben Ben Sgro, Chief Engineer ProjectSkyLine - Defining New Horizons +1 718.487.9368 (N.Y. Office) Our company: www.projectskyline.com Our products: www.project

Re: [nyphp-talk] inserting data into MySQL table.

2007-07-24 Thread PaulCheung
Yep!! as Chris said it was a rogue ";" there were other problems but they have all now been solved. Once again thanks to everybody for all your help. Paul - Original Message - From: "csnyder" <[EMAIL PROTECTED]> To: "NYPHP Talk" Sent: Monday, July 23, 2007 10:13 PM Subject: Re: [nyph

Re: [nyphp-talk] who's calling me?

2007-07-24 Thread Kenneth Downs
The wider world here is xdebug, at www.xdebug.org. It adds backtraces to error messages by default, adds in profiling, traces, and live debugging. Rahmin Pavlovic wrote: Say I'm an include. Say several templates include me into what will become a single web page. How can I tell which templat

[OT] Re: [nyphp-talk] Oh... Interviewing LOLCats

2007-07-24 Thread inforequest
Im noisin' ur talk list, fur-gettin me mannerz Tim Lieberman tim_lists-at-o2group.com |nyphp dev/internal group use| wrote: csnyder wrote: On 7/23/07, tedd <[EMAIL PROTECTED]> wrote: Who would anyone want to work for a company like that? (Rhetorical) My new policy is to ask the appli