Hi,
ich hab erneut wieder ein problem und komme nicht dahinter wieso hier array unique nicht will...
PHP-Code:
$iSql = "SELECT DISTINCT f_value FROM t_customer_datafields WHERE f_label = 'bla' ORDER BY f_value ASC;";
$result = mysql_query($iSql) OR die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
$array = array_unique(explode(";",$row['f_value']));
var_dump($array);
}
vardump array
PHP-Code:
array(1) { [0]=> string(0) "" }
array(1) { [0]=> string(5) "orange" }
array(1) { [0]=> string(10) "orange baum" }
array(1) { [0]=> string(11) "apfel strudel" }
array(1) { [0]=> string(12) "nuss baum" }
array(2) { [0]=> string(12) "nuss baum" [1]=> string(11) "apfel strudel" }
array(1) { [0]=> string(7) "erdbeer strauch" }
vardump row
PHP-Code:
array(1) { ["f_value"]=> string(0) "" }
array(1) { ["f_value"]=> string(5) "orange" }
array(1) { ["f_value"]=> string(10) "orange baum" }
array(1) { ["f_value"]=> string(11) "apfel strudel" }
array(1) { ["f_value"]=> string(12) "nuss baum" }
array(1) { ["f_value"]=> string(24) "nuss baum;apfel strudel" }
array(1) { ["f_value"]=> string(7) "erdbeer strauch" }
wie in vardump row zu erkennen steht dort "nuss baum;apfel strudel" die werte müssen getrennt sein. siehe explode func. funktioniert auch soweit nur habe ich doppelte werte in der drop down liste, array unique scheint hier keine wirkung zu zeigen
über hilfe wäre ich dankbar


