Buenas tardes por favor ayudenme, requiero simplificar estos 6 mysqli_querys en 1 sola:
$result1 = mysqli_query($conn, "SELECT MAX(id_cart) id_cart , quantity FROM ps_cart_product ")
or die ("problemas en consulta:".mysql_error()) ;
while ($row1 = mysqli_fetch_array($result1)){
$id_cart = $row1['id_cart'];
$result2 = mysqli_query($conn, "SELECT id_cart, id_product, quantity FROM ps_cart_product WHERE id_cart=($id_cart) ")
or die ("problemas en consulta:" .mysql_error());
while ($row2 = mysqli_fetch_array($result2)) {
$id_product=$row2['id_product'];
$result3 = mysqli_query($conn, "SELECT price,id_tax_rules_group FROM ps_product WHERE id_product=($id_product) ")
or die ("problemas en consulta:" . mysql_error());
while ($row3 = mysqli_fetch_array($result3)) {
$id_tax_rules_group = $row3['id_tax_rules_group'];
$result4 = mysqli_query($conn, "SELECT rate FROM ps_tax WHERE id_tax=($id_tax_rules_group) ")
or die ("problemas en consulta:" . mysql_error());
while ($row4 = mysqli_fetch_array($result4, (MYSQLI_ASSOC))) {
$result5 = mysqli_query($conn, "SELECT description_short, name FROM ps_product_lang WHERE id_product=($id_product) ")
or die ("problemas en consulta:" . mysql_error());
while ($row5 = mysqli_fetch_array($result5, (MYSQLI_ASSOC))) {
$result6 = mysqli_query($conn, "SELECT reduction FROM ps_specific_price WHERE id_product=($id_product) " ) or die ("problemas en consulta:" . mysql_error());
........
las habia hecho por separado como observan, y a ultima hora me las piden que la simplifique en una sola.
Le agradezco su apoyo, gracias.