Forums

[WordPress database error] [Nextgen Gallery] (1 post)

  1. 4nt0n
    Member
    Posted 7 months ago #

    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

Reply

You must log in to post.

About this Topic

Tags