-
Notifications
You must be signed in to change notification settings - Fork 114
Open
@maartenheideman
Description
I'll want to use your great work in combination with the WordPress wpdb class. But WordPress prepare ask for a sprintf()-like syntax in their prepare method. Is there a workaround for that? On the moment I'll use something like this
$sql = $builder->write($query);
$values = $builder->getValues();
foreach ($values as $key => $value) {
if( is_numeric($value) ){
$sql = str_replace($key, '%d', $sql);
} else {
$sql = str_replace($key, '%s', $sql);
}
};
$results = $wpdb->get_results( $wpdb->prepare($sql,array_values($values)) );
Metadata
Metadata
Assignees
Labels
No labels