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

  1. LasseMT
    Posted 1 year ago #


    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 I am using phpMyAdmin 3.5.5 on local..

Topic Closed

This topic has been closed to new replies.

About this Topic