Passing a variable to wpdb->prepare.
-
I can hardcode $find and get a result,ie, $find = ‘Jan’, but can’t find the correct syntax to make $find = $searchq work.
$searchq = $_POST['searchmonth']; echo "$searchq" . " searchq"; echo "<h3>Birthdays in ". $searchq."</h3>"; echo "<br>"; // Setup wildcard $wild = '%'; $find ='Jan'; echo "$find" . " $find" ; $like = $wild . $wpdb->esc_like( $find ) . $wild; echo "$like" . " $like" ; $SQL = $wpdb->prepare("SELECT FirstName, LastName, Birth_Month, Birth_Day FROM <code>AAUW_Members</code> WHERE Birth_Month LIKE %s",$like);
The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Passing a variable to wpdb->prepare.’ is closed to new replies.