WordPress.org

Ready to get started?Download WordPress

Forums

query is returning ID on local, but not on server. (1 post)

  1. LasseMT
    Member
    Posted 5 months ago #

    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..

Reply

You must log in to post.

About this Topic