Question

Struggling to see why this isn't returning anything - pretty sure it's a syntax mistake on my part (there are definitely rows in the wp_rg_lead_detail table with field_number of 2 and value of Trys)

function manageGetSearchEntries( $query ) {
    global $wpdb;
    $fullQuery = "SELECT * FROM wp_rg_lead_detail WHERE (%s, %s) = (%d, %s)";
    $result = $wpdb->get_results( $wpdb->prepare( $fullQuery, $query[0], $query[1], $query[2], $query[3] ), ARRAY_A );
    return $result;
}

$entryData = manageGetSearchEntries( array( 'field_number', 'value', 2, 'Trys' ) );
Était-ce utile?

La solution

That's not valid SQL. It should be more like

WHERE (%s = %d) AND (%s = %s)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top