0

I know this has been asked before, but in my case, i'm kinda stumped where i need to put my placeholders:

$prepared = $wpdb->prepare(
"
    SELECT *
    FROM tarieven
    WHERE bestemming 
    = '" . trim($_POST['destination']) . "'
",
'value', 'another value'
);

$results = $wpdb->get_results($prepared);
El Klo
  • 173
  • 3
  • 14

1 Answers1

0

Took my sweet time, but i understand it now, had to replace my var with the placeholder.

$prepared = $wpdb->prepare(
"
    SELECT *
    FROM tarieven
    WHERE bestemming 
    = %s
",
trim($_POST['destination'])
);

$results = $wpdb->get_results($prepared);
El Klo
  • 173
  • 3
  • 14