我想为页面制作这段代码
add_action( 'add_meta_boxes', 'meta_box_video' );
function meta_box_video()
{
add_meta_box( 'video-meta-box-id', 'Video Embed', 'meta_box_callback', 'post', 'normal', 'high' );
}
function meta_box_callback( $post )
{
$values = get_post_custom( $post->ID );
$selected = isset( $values['meta_box_video_embed'] ) ? $values['meta_box_video_embed'][0] : '';
wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );
?>
<p>
<label for="meta_box_video_embed"><p>Video Embed</p></label>
<textarea name="meta_box_video_embed" id="meta_box_video_embed" cols="62" rows="5" ><?php echo $selected; ?></textarea>
</p>
<p>Leave it Empty ( if you want to use an image thumbnail ) .</p>
<?php
}
add_action( 'save_post', 'meta_box_video_save' );
function meta_box_video_save( $post_id ) …
Run Code Online (Sandbox Code Playgroud) 我无法使用 wpdb->update 进行更新
这是我的代码:
$tweet = $_POST['tweet'];
$id = $_POST['id'];
$wpdb->update( $table_name, array('id' => $id , 'tweet' => $tweet ), array( 'id' => $id ),array("%d","%s"), array("%d") );
Run Code Online (Sandbox Code Playgroud)
我认为没有错,但我无法更新
感谢先进
<?php
mysql_connect('localhost','root','root');
mysql_select_db('moodle');
$ht = "";
$sql = "select * from absence where username='iset' ";
$sql_query = mysql_query($sql);
while( $row = mysql_fetch_object($sql_query) ){
$ht += "<li>".$row->classe."</li>";
}
echo $ht;
?>
Run Code Online (Sandbox Code Playgroud)
总是// 0我在'缺席'中有3行,用户名='iset'我认为$ ht的问题但是!!! 谢谢先进