Thanks for the help and explanation of multi level arrays. I changed my script so that the second value is an array and not a scaler. This eliminated the error but the script no longer filters $name.
do {
$name = $row_ws_data['workshop_name'];
$workshop['id'][] = $row_ws_data['workshop_id'];
if(!in_array($name, $workshop)){
$workshop['name'][] = $row_ws_data['workshop_name'];
} else {
$workshop['name'][] = "foo";
}
$workshop['date'][] = $row_ws_data['workshop_date'];
$workshop['iPath'][]= $row_ws_data['workshop_imagePath'];
$workshop['price'][]= $row_ws_data['workshop_price'];
$workshop['description'][] = $row_ws_data['workshop_description'];
$workshop['pdf'][] = $row_ws_data['workshop_pdfPath'];
$workshop['dateINT'][] = $row_ws_data['workshop_dateINT'];
array_multisort($workshop['id'],$workshop['name'],$workshop['date'],$workshop['iPath'],
$workshop['price'],$workshop['description'],$workshop['pdf'],$workshop['dateINT']);
}
while($row_ws_data = mysql_fetch_assoc($ws_data));
Returns:
[name] => Array
(
[0] => test1
[1] => test1
[2] => test1
[3] => test2
[4] => test2
[5] => test2
[6] => test3
[7] => test3
)
The return above is not what I want. But If I change to
if(!in_array($name, $workshop['name'])){
The script returns the following which is what I want but I also get the "Wrong datatype for second argument"
[name] => Array
(
[0] => test1
[1] => foo
[2] => foo
[3] => foo
[4] => test2
[5] => foo
[6] => test3
[7] => foo
)
Thanks again! Chris