When form doesn't know what it's sending

From: Date: Wed, 28 Feb 2001 19:24:21 +0000
Subject: When form doesn't know what it's sending
Groups: php.general 
Request: Send a blank email to php-general+get-42066@lists.php.net to get a copy of this message
Hi. i've concatenated a string from a while statement on a SQL query. example: "$mars","$venus","$jupiter". let's say i call this $planets. there are actual variables from a posted form with those names. say, $mars=1, $venus=2, $jupiter=3. however, when i echo "$planets" i get the string "$mars,"$venus"... rather than what I want: "1," "2", "3". but if echo $mars i get "1." i'm trying to create a dynamic sql insert statement because the page sending it doesn't know what/how many varialbes it's sending. if i hard code it, it works. this has been puzzling me for days! see, the 'planets' are all displayed on the form from the while statement to database table1. i.e. while (...results) $name=row[(planets)]....the other variables in the form are defined. say, $number. the statement/string reads them okay. i.e. if string/statement was ("\"$number\",\"$mars\",\"venus\") it will echo as ("54","$mars","$venus.....). have i made my problem clear? because it's sure confusing me!

« previous php.general (#42066) next »