Link14716
02-09-2004, 10:39 PM
Basically, I have put some data into the datastore (everything in a specific table that I created). I get it out and unserialize it, and then I try to pick out one row out of them all (in this case, it's one row, but that number will increase).
Naturally, my obvious choice is foreach. Of course, naturally I've hardly ever (read: never) used foreach, so I'm having some trouble.
foreach ($storeactions as $key => $theaction) {
if ($key == "actionid") {
if ($theaction['actionid'] != $_REQUEST['actionid']) {
unset($theaction);
unset($thisaction);
} else {
$action[$key] = $theaction[$key];
$thisaction = "1";
unset($theaction);
}
} else {
$action[$key] = $theaction[$key];
}
}
I was able to make that code actually pick the right row and set something to the variables, but it only wants to put the first character of each of the values into it... Obviously I am doing something wrong, but what am I doing wrong?
Naturally, my obvious choice is foreach. Of course, naturally I've hardly ever (read: never) used foreach, so I'm having some trouble.
foreach ($storeactions as $key => $theaction) {
if ($key == "actionid") {
if ($theaction['actionid'] != $_REQUEST['actionid']) {
unset($theaction);
unset($thisaction);
} else {
$action[$key] = $theaction[$key];
$thisaction = "1";
unset($theaction);
}
} else {
$action[$key] = $theaction[$key];
}
}
I was able to make that code actually pick the right row and set something to the variables, but it only wants to put the first character of each of the values into it... Obviously I am doing something wrong, but what am I doing wrong?