Skip to main content
code formatting
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

This is one way to do it that I've checked and it works:

$search_text = "%" . $_GET['some_text'] . "%";

$user_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM mix_library WHERE ml_setting_name LIKE %s", $search_text ) );

$search_text = "%" . $_GET['some_text'] . "%";

$user_count = $wpdb->get_var( 
    $wpdb->prepare( 
        "SELECT COUNT(*) FROM mix_library WHERE ml_setting_name LIKE %s", 
        $search_text 
    ) 
);

Replace variables to suit your needs.

This is one way to do it that I've checked and it works:

$search_text = "%" . $_GET['some_text'] . "%";

$user_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM mix_library WHERE ml_setting_name LIKE %s", $search_text ) );

Replace variables to suit your needs.

This is one way to do it that I've checked and it works:

$search_text = "%" . $_GET['some_text'] . "%";

$user_count = $wpdb->get_var( 
    $wpdb->prepare( 
        "SELECT COUNT(*) FROM mix_library WHERE ml_setting_name LIKE %s", 
        $search_text 
    ) 
);

Replace variables to suit your needs.

Source Link

This is one way to do it that I've checked and it works:

$search_text = "%" . $_GET['some_text'] . "%";

$user_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM mix_library WHERE ml_setting_name LIKE %s", $search_text ) );

Replace variables to suit your needs.