The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
[09:58:37] Error in mysql_query: Query was empty
Originally Posted by Thanatos
one question: why do you use varchar for integers/digits?
|
Money = "a lot"
[09:58:37] Error in mysql_query: Query was empty
-- phpMyAdmin SQL Dump -- version 2.11.9.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 29, 2009 at 11:10 AM -- Server version: 5.0.45 -- PHP Version: 5.1.6 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `dbhex127` -- -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `Username` varchar(30) NOT NULL, `Password` varchar(50) NOT NULL, `Money` int(10) NOT NULL default '0', `Kills` int(10) NOT NULL default '0', `Deaths` int(10) NOT NULL default '0', `Admin` int(10) NOT NULL default '0', `Donator` int(10) NOT NULL default '0', `Cmem` int(10) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`Username`, `Password`, `Money`, `Kills`, `Deaths`, `Admin`, `Donator`, `Cmem`) VALUES ('[UF]XtreaMeR', 'eb02afeb8d9580122adfccf7e62c48eb', 0, 0, 0, 0, 0, 0);
MySQLNewColumns() //initializes new rows to the current table! { new haystack[64]; format(haystack,sizeof(haystack),"SHOW columns FROM `users`"); samp_mysql_query(haystack); samp_mysql_store_result(); if(samp_mysql_num_rows() < 10) { samp_mysql_query("ALTER TABLE `users` ADD Admin INT(10) NOT NULL DEFAULT '0'"); samp_mysql_query("ALTER TABLE `users` ADD Donator INT(10) NOT NULL DEFULT '0'"); samp_mysql_query("ALTER TABLE `users` ADD cmem INT(10) NOT NULL DEFULT '0'"); samp_mysql_query("CREATE TABLE IF NOT EXISTS `banlist`(`id` INT(11) NOT NULL auto_increment PRIMARY KEY,\ `Name` VARCHAR(30) NOT NULL,\ `IP` VARCHAR(40) NOT NULL,\ `Reason` TINYTEXT NOT NULL)"); } return 1; }
stock RegPlayer(playerid,pass[]) { MySQLCheck(); new pName[MAX_PLAYER_NAME], query[256], string[256]; GetPlayerName(playerid,pName,sizeof(pName)); samp_mysql_real_escape_string(pName,pName); samp_mysql_real_escape_string(pass,pass); format(query,sizeof(query),"INSERT INTO `users` (Username,Password) VALUES ('%s',md5('%s'))",pName,pass); samp_mysql_query(query); samp_mysql_free_result(); format(string,sizeof(string),">> Account %s successfully registered ( Password: %s )",pName,pass); SendClientMessage(playerid,GREY,string); SendClientMessage(playerid,GREY,"You have been automatically logged in"); LoggedIn[playerid] = 1; AccRegistered[playerid] = 1; AccountInfo[playerid][Money] = 0; AccountInfo[playerid][Kills] = 0; AccountInfo[playerid][Deaths] = 0; AccountInfo[playerid][AdminLevel] = 0; AccountInfo[playerid][DonatorLevel] = 0; AccountInfo[playerid][ClanMember] = 0; return 1; } stock LoginPlayer(playerid,pass[]) { new pName[MAX_PLAYER_NAME], query[256], string[256], result[256], loop[256], poop = 1; GetPlayerName(playerid,pName,sizeof(pName)); MySQLCheck(); samp_mysql_real_escape_string(pName,pName); samp_mysql_real_escape_string(pass,pass); format(query,sizeof(query),"SELECT * FROM `users` WHERE Username = '%s' AND Password = md5('%s')",pName,pass); samp_mysql_query(query); samp_mysql_store_result(); samp_mysql_fetch_row(result); if(samp_mysql_num_rows() == 1) { samp_mysql_strtok(loop, "|", result); while(samp_mysql_strtok(loop, "|", "")) { if(poop == 3) AccountInfo[playerid][Money] = strval(loop); if(poop == 4) AccountInfo[playerid][Kills] = strval(loop); if(poop == 5) AccountInfo[playerid][Deaths] = strval(loop); if(poop == 6) AccountInfo[playerid][AdminLevel] = strval(loop); if(poop == 7) AccountInfo[playerid][DonatorLevel] = strval(loop); if(poop == 8) AccountInfo[playerid][ClanMember] = strval(loop); poop++; } samp_mysql_free_result(); GivePlayerMoney(playerid,AccountInfo[playerid][Money]); LoggedIn[playerid] = 1; format(string,sizeof(string),">> You have been successfully logged in. (Kills/Score: %d | Deaths: %d | Money: %d | Donator Level %d)",AccountInfo[playerid][Kills],AccountInfo[playerid][Deaths],AccountInfo[playerid][Money],AccountInfo[playerid][DonatorLevel]); SendClientMessage(playerid,GREY,string); if(AccountInfo[playerid][AdminLevel] > 0) { new send[128]; format(send,sizeof(send),">> %s has logged in as level %d Admin",pName,AccountInfo[playerid][AdminLevel]); SendClientMessageToAll(YELLOW,send); } printf("User %s has logged in ( Money: %d,Kills/Score: %d,Deaths: %d, Donator level: %d )",pName,AccountInfo[playerid][Money],AccountInfo[playerid][Kills],AccountInfo[playerid][Deaths],AccountInfo[playerid][DonatorLevel]); return 1; } else { SendClientMessage(playerid,RED,">> Wrong Password"); Wrongattempt[playerid] += 1; printf("Bad log in attempt by %s (Total attempts: %d)",pName,Wrongattempt[playerid]); } return 1; }