Thanks for the problem with the previous array xuzuning help me answer, I want to ask another, if I put the table type value in the array this can also do?
The following array is implemented through the table above
Array ( [classname] = Array ( [0]=> [1]=> Wedding service [2]=> mechanical Equipment [3]=> Hospital Medical [4]=> Lighting [5]=> Education Training [6]=> Chemical coating [7]=> Beauty Fitness [8]=> food [9]=> Car service ) [Layout] = Array ( [0]=> [1]=> General [2]=> Two column [3]=> three columns [4]=> grid ))
Reply to discussion (solution)
According to my writing, $res is the format you want now.
Because your post wants an array of subscripts, there will be
$res = Array_values ($res);
$classname = "SELECT * from table where type= ' classname '", $layout = "SELECT * from table where type= ' layout '";
According to my writing, $res is the format you want now.
Because your post wants an array of subscripts, there will be
$res = Array_values ($res);
Xuzuning I just tried to come out, thank you, that is what you said with $res this format, there is a problem, if I want to output when the "unlimited" two words to replace the empty value to how to operate?
In all of your previous descriptions, there is no "unlimited" two characters
In all of your previous descriptions, there is no "unlimited" two characters
Sorry, just found that the uploaded data are old. The Typevalue value for type=0 is "unlimited". Or is that OK? is how to implement the Typevalue value of the corresponding row as a null value when type=0 in the result of an array output
while ($row = Mysql_fetch_assoc ($rs)) {
if ($row [' typeid '] = = 0) $row [' typevalue '] = ';
$res [$row [' type ']][] = $row [' Typevalue '];
}
while ($row = Mysql_fetch_assoc ($rs)) {
if ($row [' typeid '] = = 0) $row [' typevalue '] = ';
$res [$row [' type ']][] = $row [' Typevalue '];
}
Okay, thank you so much.