MySQL query
#1

Why my table didn't was veryfied with succes?

pawn Код:
public MySQL_Start()
{
    print("Conecting at MySQL");
    MySQL_Connected = mysql_connect(mysql_host,mysql_user,mysql_database,mysql_password);
    if(!MySQL_Connected) return print("Connection with MySQL was not possible.");
    else
    {
        mysql_function_query(MySQL_Connected,"CREATE TABLE IF NOT EXISTS `users` (`id` int(11) NOT NULL, AUTO_INCREMENT,`name` varchar(25) NOT NULL,`password` varchar(25) NOT NULL,`score` int(11) NOT NULL,`bank` int(11) NOT NULL,`skin` int(11) NOT NULL,`money` int(11) NOT NULL,PRIMARY KEY(`id`))",false,"MySQL_Start_Response","s","users");
    }
    return 1;
}

// The response

public MySQL_Start_Response(text[])
{
    return Printf("%s table verified succesfully.",text);
}
All i'm getting is "Conecting at MySQL" and nothing more...

Could someone help me? Thanks...
Reply
#2

Nothing more as in it doesn't create the table? Or nothing more as in it doesn't send the verification method.

Looking at what you have posted, I see you created the MySQL_Start_Response function, but I don't see it called on anywhere. Did you forget to add it to the MySQL_Start function?

Also, I'm not sure why have text[] in the parameters of the function.
Reply
#3

It doesn't create de table.

MySQL_Start_Response is implemented at query function, but it doesn't get called :/
Reply
#4

Edit: I've withdrawn my code. Took a second look.

Quote:
Originally Posted by RVRP
Посмотреть сообщение
Nothing more as in it doesn't create the table? Or nothing more as in it doesn't send the verification method.

Looking at what you have posted, I see you created the MySQL_Start_Response function, but I don't see it called on anywhere. Did you forget to add it to the MySQL_Start function?

Also, I'm not sure why have text[] in the parameters of the function.
mysql_function_query - this calls a function.
Reply
#5

Sorry, I didn't scroll over all the way. For some reason I can only see a small amount of the actual text in the code box.
Reply
#6

Did this get resolved?

Just incase it didn't. Turn on mysql_debug so that you get a log saved into the main root of your servers directory, it will let you see if it is connecting succesfully or not and then you could look to see if there is any errors stated on the log when the query is sent.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)