Receiving a "Fatal error: Call to undefined function get_current_user_id()" when I call this function within my script. My script is located in my public_html folder and not any Wordpress folder. I have attempted to require the pluggable.php file and it did not help. This is not a plugin that is trying to call the function, but a script that is executed from a button within my plugin.
$user_ID = get_current_user_id();
$query = "SELECT * FROM wp_users WHERE ID=".$user_ID;
$result = mysql_query($query);
$data = mysql_fetch_object($result);
$query2 = 'UPDATE booking SET source=destination WHERE status=0 AND
userid=$data->ID ';
$result = mysql_query($query2);