$wpdb->get_var Fatal Errro
-
Hey all,
I am using the code below –
$contactLink = $wpdb->get_var('SELECT post_name FROM wp_posts WHERE post_title="' . $contact->name . '" AND post_status="publish"');
– to try and pull the details of a Post so that I can link to it, but it’s trhowing up a fatal error –Fatal error: Call to a member function get_var() on a non-object in … on line …
I’m not sure where I am going wrong here, so any help would be appriciated.
Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘$wpdb->get_var Fatal Errro’ is closed to new replies.