我正在尝试动态获取 NextGen 画廊 ID 并出现 SQL 语法错误
#1064 - You have an error in your SQL syntax
看看下面我犯错的代码
<?php
global $wpdb;
global $post;
$galleryid = get_post_meta( $post->ID, 'image_gallery', true );
$pictures=$wpdb->get_results("SELECT * FROM wp_ngg_pictures WHERE galleryid='$galleryid'");
?>
还是我做错了?