Jump to content

Mysql problem


Linjon

Recommended Posts

Thanks, that worked!! But i have new problem now. If i add points then it give points only for first user on database and change him id to 0. How can i fix it?

<?php
  mysql_connect("localhost", "*******", "*****");
  mysql_select_db("*********");
  $result = mysql_query("SELECT `player_id` FROM `wc3_player` WHERE `player_name` ='".$_GET['message']."'");
  if(mysql_num_rows($result) == 0) {
  echo 'Cant find that name';
  }
  if(mysql_num_rows($result) > 0) {
  echo 'Points are added';
  $addxp = $row['race_xp'] = 75000; 
  mysql_query("UPDATE `wc3_race` SET `player_id`='".$_GET['message']."', `race_id` ='1', `race_xp`= `race_xp` + ".$addxp);
  }
?>

Link to comment
https://forums.phpfreaks.com/topic/191392-mysql-problem/#findComment-1010928
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.