Trouble putting data into database...??
Posted: Sun Mar 19, 2006 1:29 pm
feyd | Please use
The above code will put out X amount of "qty" & "Units" & "Color" depending on how many items there are.
So it might come out like:
I need to put all of that into a single string. Something like:
The problem is, the code is in the FOR loop like you see above. If i put the $string into the FOR loop, $string will loose the value of the prev loop, and get new info from the current loop.
How can I get all loops into one string?
Thanks![/i]
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I have this piece of code which i am getting the below dataCode: Select all
session_start();
$ArrayList = array("_GET", "_POST", "_SESSION", "_COOKIE", "_SERVER");
foreach($ArrayList as $gblArray)
{
$keys = array_keys($$gblArray);
foreach($keys as $key)
{
$$key = trim(${$gblArray}[$key]);
}
}Code: Select all
for ($x = 0; $x < $items; $x++)
{
$qty = "qty";
$units = "units";
$color = "color";
${$qty.$x};
${$units .$x};
${$color .$x};
}So it might come out like:
Code: Select all
3 pens blue
5 gloves brown
and so onCode: Select all
$string = ${$qty.$x} . " " . ${$units .$x} . " " . ${$color .$x} . "<br>";How can I get all loops into one string?
Thanks![/i]
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]