• I have created the following function

    function nggfirstImage()
    	{
    	   global $wpdb;
    	   $firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->wp_ngg_pictures WHERE galleryid=1 AND sortorder=1");
    	   	echo $firstImage;

    }

    But I get the following error..

    [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE galleryid=1 AND sortorder=1’ at line 1]
    SELECT pid FROM WHERE galleryid=’1′ AND sortorder=’1′

    Any ideas??

    cheers
    4nt0n

  • The topic ‘[WordPress database error] [Nextgen Gallery]’ is closed to new replies.