[wp-trac] [WordPress Trac] #4090: $wpdb->get_var("SELECT 1 FROM ...
") not working
WordPress Trac
wp-trac at lists.automattic.com
Thu Apr 5 16:37:36 GMT 2007
#4090: $wpdb->get_var("SELECT 1 FROM ... ") not working
---------------------+------------------------------------------------------
Reporter: orvar | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.3
Component: General | Version:
Severity: normal | Keywords: get_var wpdb
---------------------+------------------------------------------------------
Using queries like
{{{
$a = $wpdb->get_var("SELECT 1 FROM ... ")
}}}
to confirm the existence of something in a table does not work ($a is not
set to 1). wpdb seems to have a problem with the fact that the column has
a numerical name in the result as
{{{
$a = $wpdb->get_var("SELECT 1 AS x FROM ... ")
}}}
works fine ($a == 1).
--
Ticket URL: <http://trac.wordpress.org/ticket/4090>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list