I want to use php function in SQL query,
I want to use str_replace() in SQL query,
db_query('SELECT * FROM {node} n INNER JOIN {accesslog} a ON n.nid = str_replace("node/", "", a.path开发者_C百科);
but still not work. please help.
thank you.
Pick a function that the SQL engine does know, such as REPLACE()
.
Use MySQL's REPLACE
function instead of PHP's str_replace
.
精彩评论