$wpdb->get_results() can not fetch row if collunm name is integer
-
Hi,
I have a problem while fetching rows from table. Some of my column name(into table) like 1,2,3,4 etc.I used following way to fetch results from database. Code is something like following..
$results=$wpdb->get_results(“SELECT * FROM mytable”);
if($wpdb->num_rows)
{
foreach ($results as $result)
{
echo $result->1; (Not Works)
echo $result->2; (Not Works)
echo $result->mycolname; (Works)
}
}have any solution… thanks a lot.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘$wpdb->get_results() can not fetch row if collunm name is integer’ is closed to new replies.