Hi
to turn var3 from an array into a string (assuming you are using PHP)
use implode()
implode ( string glue, array pieces)
ie if your array $arr contains 3 elements a, b, c
$text_string= implode(", ", $arr);
$text_string will then = "a, b, c"
Hi,
Using a form I'm try to update 3 variables, all of which are arrays.
$var1 and $var2 are checkbox results and no problem, but $var3 is a text input, and I'm having trouble updating results.
eg. $var3 = text:more text:even more text:
I can create a db entry, using
but can't update. Even tried Delete from and recreate entry, but still not working. I think the solution is to pass it ($var3) as a normal variable and not an array.PHP Code:$result = sql_query("insert into ".$prefix."_blah values ('$id', '$var1', '$var2', '$var3')", $dbi);
Sorry if this makes no sense, but any help appreciated!
Chris
Hi
to turn var3 from an array into a string (assuming you are using PHP)
use implode()
implode ( string glue, array pieces)
ie if your array $arr contains 3 elements a, b, c
$text_string= implode(", ", $arr);
$text_string will then = "a, b, c"
Follow Me | Looking for Merchants Who Do Scifi Stuff
Thanks scifind,
funny when I asked the question I wondered if the answer might be blindingly obvious!
Thanks very much, ended 4 days of hair pulling (not much there to begin with).
Cheers
Chris
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks