how can i give everyone in the users table 5,000 coins as a mysql query?
i run phpretro
how can i give everyone in the users table 5,000 coins as a mysql query?
i run phpretro
not a commmand, a query
I know what you mean, but i'm not sure, copy from Uber, also, wrong section.
-Offtopic: 400 POSTS!
This is in the wrong section bud..
And i don't know..
I think you just save this:
UPDATE users SET credits = '5000'
in a text file, then go to localhost/phpmyadmin and go to your database, go to users, click import and choose that text file. Done!?!
Go to your database, click "SQL Query" or "Query". Type the thing below (fill in the blanks appropriately);
Code:UPDATE <account table> SET <credits column> = '<amount>'
Example (in me.php):
PHP Code:$date = date("m.d.y");
$sqlcode = mysql_query("SELECT username FROM user_credits WHERE time = '".$date."' AND username = '".$myrow["username"]."'");
$codu = mysql_fetch_array($sqlcode);
if($codu < 1){
mysql_query("UPDATE users SET credits = credits + 3000 WHERE id = '".$myrow['id']."' LIMIT 1") or die(mysql_error());
$sql = "INSERT INTO user_credits (username,time) VALUES ('".$myrow["nickname"]."','".$date."');";
mysql_query($sql) or die(mysql_error());
}
Credits by Me :)
Edit: with this Code it Update it automatic :)
Last edited by Mininova; 20-08-10 at 08:22 PM.
thanks for this Jacob!