WordPress.org

Support

Support » Plugins and Hacks » query is returning ID on local, but not on server.

query is returning ID on local, but not on server.

  • Hi!

    I am using this script to get the attachment id from src (url).

    function get_attachment_id_from_src($image_src) {
    
    		global $wpdb;
    		$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
    		$id = $wpdb->get_var($query);
    		return $id;
    	}

    The script is working fine on localside. But it wont output any ID when uploaded to server at one.com..

    One.com is using phpMyAdmin 3.5.8.1. I am using phpMyAdmin 3.5.5 on local..

  • The topic ‘query is returning ID on local, but not on server.’ is closed to new replies.