Additionally, if you just want to get all idChild values and match them with idParent values, you can modify the above $query to:
$query = sprintf('SELECT idParent, idChild FROM dbtable');
Then change the while line to:
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
//do stuff
echo $row['idChild'];
echo $row['idParent'];
}
|