The while variable goes out differently?
function Type_son_id_finder ($type _id) {
$query =mysql_query ("Select id from ' protduct_type ' WHERE ' f_id ' = ' $type _id '");
while ($row =mysql_fetch_assoc ($query)) {
return $all _son = $row ["id"]. ",";
}
}
This method is to enter a parent column ID to find out what the sub-column ID
The above method
should be the output
1, 2,
But only output
1,
But if you put
return $all _son = $row ["id"]. ",";
Switch
echo $all _son = $row ["id"]. ",";
Can normally show 1, 2,
Why is this?
How do I fix it?
I'm trying to get this method out to the end.
The
Let me in the where ID in MySQL
But now you can only output the first one, you can't use return, only echo?
Solving!
------Solution--------------------
function Type_son_id_finder ($type _id) {
$query =mysql_query ("Select id from ' protduct_type ' WHERE ' f_id ' = ' $type _id '");
$all _son = ";
while ($row =mysql_fetch_assoc ($query)) {
$all _son. = $row ["id"]. ",";
}
return $all _son;
}