Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是wordpress的新手。我不知道从表中获取/获取数据并回显的语法。
请帮助我。
并告诉我使用 mysql 在 php 中获取和回显的语法。
谢谢。
使用wpdb类:
wpdb
$myrows = $wpdb->get_results( "SELECT id, name FROM mytable" ); var_export($myrows);
参考Wordpres.org
$row = $wpdb->get_row("SELECT post_content name FROM bu_posts where ID='56'"); echo $row->post_content;