Support

Account

Home Forums General Issues use acf inside mysql query

Helping

use acf inside mysql query

  • hy im trying to get the variable from the_sub_field(‘imgimg’);
    to my sql query

    while ( have_rows(‘extras’,1) ) : the_row();

    $var=the_sub_field(‘imgimg’);

    echo $sql = “SELECT count(*) as total from student where gift like ‘”.$var.”‘”;

    endwhile;

    i can print the variable , but when trying to use it inside mysql its not showing

    thank you

  • the :
    echo $var;
    works perfect

    but the query shown as
    SELECT count(*) as total from student where gift like ”;

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘use acf inside mysql query’ is closed to new replies.