Jump to content

db call


far2slow

Recommended Posts

i want to know if there is away i can get rid off t.roworder and t.place in sql there action is COUNT( * ) AS `Rows` , `place`        and            COUNT( * ) AS `Rows` , `roworder`  so can i add somthing to the php that will let me do this with out the sql

 

 $request = $smcFunc['db_query']('', '
      SELECT mg.id_group, mg.group_name, mg.online_color, mg.stars, t.place, t.roworder
      FROM ({db_prefix}membergroups AS mg, {db_prefix}team AS t)
      WHERE mg.id_group = 1
      ORDER BY t.roworder', array()
   );

   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
      $row['stars'] = empty($row['stars']) ? array('', '') : explode('#', $row['stars']);

      $context['display_groups'][$row['place']][$row['id_group']] = array(
         'name' => $row['group_name'],
         'color' => $row['online_color'],
         'image' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row['stars'][1]) ? $settings['images_url'] . '/' . $row['stars'][1] : '') . '" alt="*" border="0" />', empty($row['stars'][0]) || empty($row['stars'][1]) ? 0 : $row['stars'][0]),
         'members' => array(),
         'place' => $row['place'],
      );

Link to comment
https://forums.phpfreaks.com/topic/242288-db-call/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.