A Question about wpdb->prepare()
-
Hello,
I never used wpdb->prepare or sprintf() before, so I have a question about them:
When I execute something like that:$table_name = $wpdb->prefix . 'mysqlitable'; $wpdb->prepare('INSERT INTO ′%s′( ′name′ , ′num′ ) VALUES ("%s", "%s")', array($table_name, $listname, $number));
The outcomming Query is:
INSERT INTO ′'wp_mysqltable'′ (
name,
num) VALUES ('test', '1');
But because of the ‘ that was included there, the query is invalid. How do I fix that?PS: The backticks in the query are normally in the right direction but thanks to the wordpress forum code they are changed to “< code>” so I had to flick them`
- The topic ‘A Question about wpdb->prepare()’ is closed to new replies.