Mysql query doing nothing ? -
Dotayuri - 25.02.2013
phpMyAdmin shows no changes in my database no INSERT or CREATE, why ?
I checked my: host, database, pass and username and there all right.
PHP код:
//============================================================================//
// Includes //
//============================================================================//
#include <a_samp>
#include <a_mysql>
#include <zcmd>
#include <sscanf2>
//============================================================================//
// Defines //
//============================================================================//
#define host ""
#define user ""
#define pass ""
#define db ""
//============================================================================//
// Main //
//============================================================================//
main() {}
public OnGameModeInit() {
mysql_debug(1);
print("-------------------------------------------------------------");
print(" Game Mode Loaded!");
print("-------------------------------------------------------------");
mysql_connect(host, user, db, pass);
mysql_query("INSERT INTO `accounts` (username, password) VALUES ('Nickname', SHA('Pass'))");
if(mysql_ping()) {
print("Connection to database successful.");
} else if (!mysql_ping()) {
print("Connection to database failed.");
} else {
print("Unknown error!");
}
return 1;
}
Re: Mysql query doing nothing ? -
InfiniTy. - 25.02.2013
Did you even fill this up with your DB details ?
pawn Код:
#define host ""
#define user ""
#define pass ""
#define db ""
Re: Mysql query doing nothing ? -
Dotayuri - 25.02.2013
Yes, i checked it 5 times now and there all right
Re: Mysql query doing nothing ? -
InfiniTy. - 25.02.2013
Quote:
Originally Posted by Dotayuri
Yes, i checked it 5 times now and there all right
|
Do you have the table ? What does it say in mysql_log ? or debug or whatever you have ?
Re: Mysql query doing nothing ? -
Dotayuri - 25.02.2013
yes i have the table and both are set to varchar 255.
all my programs say everythings ok
Re: Mysql query doing nothing ? -
Dotayuri - 25.02.2013
Bump~
Can anyone help ? i tryied the mysql_query in phpMyAdmin and it worked:
PHP код:
"INSERT INTO `accounts` (username, password) VALUES ('Nickname', SHA('Pass'))"
And i got:
PHP код:
Nickname and "d7cd56f2a2a3f47830760edfb89946eb7b9e2cd1"
Re: Mysql query doing nothing ? -
InfiniTy. - 25.02.2013
Show mysql_log or debug or whatever you have.. maybe there's the problem
Re: Mysql query doing nothing ? -
Dotayuri - 25.02.2013
Its telling me
PHP код:
(10060) (Error ID: 2003)
I dont get it the info is all right
Re: Mysql query doing nothing ? -
Misiur - 25.02.2013
Can't connect to host error
#sidenote:
pawn Код:
if(mysql_ping()) {
print("Connection to database successful.");
} else if (!mysql_ping()) {
print("Connection to database failed.");
} else {
print("Unknown error!");
}
Boolean can have 2 states only: true, or false. So in fact you are doing something like
pawn Код:
if(true) { print("Cool"); }
else if(false) { print("NotCool"); }
else { printf("This will never happen"); }
Re: Mysql query doing nothing ? -
Dotayuri - 25.02.2013
I took that off, i even copy and paste the info into fillezilla and it connects fine