[wp-hackers] Plugins using hardcoded table prefix

David House dmhouse at gmail.com
Tue Mar 22 13:41:57 GMT 2005


> This works:
> 
> $sql = "SELECT * FROM {$wpdb->posts} WHERE ...";

Not necessary. You can use the $object->property syntax from inside
double quotes as well, as stated in the PHP documentation [1]:

"Similarly, you can also have an array index OR AN OBJECT PROPERTY parsed."

Emphasis mine. An example is also given:

// Works
echo "This square is $square->width meters broad.";

[1]: http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing.simple

-- 
-David House, dmhouse at gmail.com


More information about the wp-hackers mailing list