Advertisement:

Author Topic: [SOLVED]selecting all cityArea under a city is not working using custom query  (Read 717 times)

osclassLover

  • Newbie
  • *
  • Posts: 39
  • thinking to achieve new in osclass
i am using modern, theme

there i have stored cityArea under a city.

when i selecting the all area under a city its giving only one area only, i dont know why...

for example:

i have list 3 area under a city

sample 1, sample 2 , sample 3( cityId for this areas are same (50000) )

i use the following custom query inside functions.php file.

$conn = getConnection();
/
      $area = $conn->osc_dbFetchResult("SELECT * FROM `oc_t_city_area`WHERE `fk_i_city_id` =50000");
           print_r($area);
 but it prints the sample 1 only in the result, i dont know why

pls help me someone...thanks...

« Last Edit: May 02, 2015, 04:37:49 pm by osclassLover »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Hi,

Subtle, but decisive. :D

osc_dbFetchResult (returns only one row)

osc_dbFetchResults (returns a number of rows).

Regards

osclassLover

  • Newbie
  • *
  • Posts: 39
  • thinking to achieve new in osclass
yes your code worked, thanks teseo.

thanks for the help.