Reply to Re: wandering in dis- array

Your name:

Reply:


Posted by Captain Paralytic on 11/07/06 10:09

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";
}

[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

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