How can i use the mysqli_multi_query Function

jamesmvajamesmva brazil

How can i use the mysqli_multi_query Function work for me.
This is my code, where it loads my posts categories.

<?php
$sel_cat = "SELECT * FROM posts WHERE category = '$_GET[cat_name]' ";
$run_cat = mysqli_query($conn,$sel_cat);
while($rows = mysqli_fetch_assoc($run_cat)){
echo.....

And what i want to do is load only categories that is in published mode... this is what i want to do...

<?php
$sel_sql = "SELECT * FROM posts WHERE status = 'published' ORDER BY id DESC LIMIT $start_from, $per_page";
$sel_cat = "SELECT * FROM posts WHERE category = '$_GET[cat_name]' ";
$run_cat = mysqli_query($conn,$sel_cat);
while($rows = mysqli_fetch_assoc($run_cat)){
echo.....

I've tried the mysqli_multi_query() Function but i dont know what i did wrong cuz it still didnt work.

how can i make this work?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories