Reply to Re: wandering in dis- array

Your name:

Reply:


Posted by strawberry on 11/07/06 17:43

Captain Paralytic wrote:
> strawberry wrote:
> > You're quite right, of course! Call me a dummie if you like but the
> > only way I could think of resolving that was to ask again whether or
> > not $key = 'name'
> > This doesn't look very elegant but it looks like it might work. I'll
> > turn the echoes into real mysql statements and see what happens. Maybe
> > I don't have to bother with the implosion
> > I described. I guess it just means more INSERT statements - but so
> > what, right?
>
> Nah, I won't call you a dumie, but I will suggest that what you may
> want to do is to change the innermost if statement to something like
> this:
>
> if ($key == 'name') {
> $table = $value;
> } elseif {
> ($key == 'ID') {
> echo "INSERT INTO $table (ID) VALUES ('$value')<BR>\n";
> } else {
> echo "INSERT INTO $table ($key) VALUES ('$value') UPDATE ON
> DUPLICATE KEY<BR>\n";
> }

Thanks, Paul. That definitely feels like a step forward. Now I've just
got to resolve the tips you've given me with those proposed by Jerry. I
don't know if there's a correct protocol for closing a thread so I'll
just say that I'd like to close this thread - before I get flamed again
;-) - and continue it over at

http://groups.google.com/group/comp.lang.php/browse_thread/thread/f2a8ce8e295c9e66/a189013650ff79a5#a189013650ff79a5

I'll try and post the latest version of the function, incorporating
everyone's comments, later today so that, if you (or anyone) wishes to
continue to contribute we can be sure we're talking about the same
thing.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация