MySQL help
#1

It just wouldn't connect to my MySQL, it drops the connection and closes the server.
This is how I fetch my server into the MySQL server:
PHP код:
    mysql_connect("127.0.0.1""root""roleplay""acciara123"); 
Maybe you got any idea what could it be?
Reply
#2

All of the parameters could be wrong. It's your database, so you should know what the username, password and database name is.
Reply
#3

from what I know it's right, I mean the PHPmyadmin loads and all, so I really don't know what's the problem.
Reply
#4

Check your logs made by the plugin.
Reply
#5

I did, the mysql log doesn't even recall the connection.
But the server log writes this:
PHP код:
[17:09:23]  * SQLConnection seems deadretrying...
[
17:09:23]  * SQLCould not reconnect to serverterminating server.. 
This is called because of my MySQLCheckConnection function.
Reply
#6

Show your MySQLCheckConnection function. You must say what plugin are you using.
Reply
#7

Forget it, I fixed that problem myself, but now I have a new one
When I try and get information from the SQL db and place it into one of my variables thats what it writes:
PHP код:
[Sun Jul 10 18:59:02 2011Error (0): Function: mysql_store_result called when no prior successful query executed.
[
Sun Jul 10 18:59:02 2011Error (0): Function: mysql_store_result called when no result stored
How did I try and get and put:
PHP код:
PlayerInfo[playerid][pJob] = mysql_Int(SQL_USERS,PlayerInfo[playerid][pUID],"job"); 
mysql_Int function is something I built:
PHP код:
stock mysql_Int(table[],id,key[])
{
    return 
strval(mysql_Get(table,id,key));

mysql_Get:
PHP код:
stock mysql_Get(table[],id,key[])
{
    
Query("SELECT `%s` FROM `%s` WHERE `userid` = '%d'",key,table,id);
    new 
Result[30];
    
mysql_fetch_row_format(Result);
    return 
Result;

mysql_fetch_row_format:
PHP код:
#define mysql_fetch_row_format(%1) mysql_fetch_row(%1,"|") 
Query:
PHP код:
new false;
#if defined Query
#else
    #define Query(%1,%2) do { new formatStr[256]; format(formatStr,sizeof(formatStr),%1,%2); if(SQL_Connection) mysql_query(formatStr); mysql_store_result(); } while(F)
#endif
#pragma unused F 
I use StrickenKid's plugin and all the mysql_Get & mysql_Int are inside the "mysql.inc" file.
Reply
#8

-edit-
Reply
#9

so would this work?
PHP код:
stock mysql_Get(table[], id,key[])
return 
Query("SELECT `%s` FROM `%s` WHERE `userid` = '%d'",key,table,id); 
Reply
#10

Up...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)