开发者

I want to use php function in SQL query,

开发者 https://www.devze.com 2023-01-28 18:11 出处:网络
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百科);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号