Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

SMF 2.x Database Code conversation to SMF 1.x

Aloittaja Biology Forums, helmikuu 04, 2014, 08:50:39 IP

« edellinen - seuraava »

Biology Forums

$result_shop = $smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET cash = cash + {int:points}
WHERE id_member = {int:member}
LIMIT 1',
array(
'member' => $user_info['id'],
'points' => $points,

)
);


I want this to be changed back to SMF 1.x

I know SMF 1.x uses: db_query(" and ", __FILE__, __LINE__);, but how do I use that here.

live627

db_query("
            UPDATE {$db_prefix}members
             SET cash = cash + $points
             WHERE id_member = $user_info[id]
             LIMIT 1", __FILE__, __LINE__);

margarett

I did a quick test here and, in 1.1, $user_info actually has no "id" ???
$context['user'] has "id" but it might not be available everywhere.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair


margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Biology Forums

// Earn shop credits everytime you play, but exclude guests (they don't get shop credits anyway)
if (!$user_info['is_guest'])
{
$points = 2;
db_query("
UPDATE {$db_prefix}members
SET money = money + $points
WHERE ID_MEMBER = $ID_MEMBER
", __FILE__, __LINE__);
}

Advertisement: