Title: Shortcode Exec PHP 404 Error
Last modified: August 21, 2016

---

# Shortcode Exec PHP 404 Error

 *  [gonkas](https://wordpress.org/support/users/gonkas/)
 * (@gonkas)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/shortcode-exec-php-404-error/)
 * Hi,
 * Gives me a 404 error when I try to run the following code:
 *     ```
       GLOBAL $wpdb;
       $my_gallery = $wpdb->get_results(
       	"
       	SELECT *
       	FROM wp_ngg_gallery
       	"
       );
   
       if ( $my_gallery )
       {
       	foreach ( $my_gallery as $post )
       	{
       		//setup_postdata( $post );
   
       		echo '<h2>';
       			echo '<a href="">';
       				//the following line is jus for one record show
       				//echo  $my_gallery->title;
       				//the following line is jus for multiple records show
       				echo $my_gallery['title'];
       			echo '</a>';
       		echo '</h2>';
       	}
       }
       else
       {
       	echo '<h2>No galleries Found</h2>';
       }
       ```
   
 * I want to show every record on the table wp_ngg_gallery.
    But when I run the 
   code my website goes offline. Can anyone help me?
 * Thanks in advance.
 * [https://wordpress.org/plugins/shortcode-exec-php/](https://wordpress.org/plugins/shortcode-exec-php/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [gonkas](https://wordpress.org/support/users/gonkas/)
 * (@gonkas)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/shortcode-exec-php-404-error/#post-4668599)
 * I also gives **error 0** when I save the script.

Viewing 1 replies (of 1 total)

The topic ‘Shortcode Exec PHP 404 Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [gonkas](https://wordpress.org/support/users/gonkas/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/shortcode-exec-php-404-error/#post-4668599)
 * Status: not a support question