Skip to main content
1 of 2
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

If you need to return one value then use get_var instead of get_row. get_var will return a string. get_row will return an array or object.

$spr_liczbe_wodo = $wpdb->get_var ("select liczba_wodo from wp_ow_adres where adres='Street 12/6'");
var_dump($spr_liczbe_wodo);

The problem with your code, by the way, is that $spr_liczbe_wodo is an object, but when you loop over it $print is not. Through in a couple of var_dumps and you can easily see the problem.

s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174