Jump to content

MySQL Problem


[PXG]Blue

Recommended Posts

Hello, i'm trying to make my server use MySQL instead of MTA's system, but i'm experiencing a problem, when i try to save the account data it doesnt get saved in the database and the mysql_free_result just says "result expected, got nil"

Here is my Working code:

     
 result = mysql_query(handler, "INSERT INTO test (Name) VALUES ( 'meh' )") 
     mysql_free_result ( result ) 
  

b5703d7d2a.png

And this is one doesnt work:

  
     result = mysql_query(handler, "INSERT INTO players (Name, Serial, IP, Last_login, drift_score, drift_best, playtime_m,playtime_h, money, posx, posy, posz, int, dim) VALUES ( 'beh', 'behewahh', 'adgagd', '244sdfa', '0', '0', '0', '0', '0', '0', '0', '0','0','0' )") 
     mysql_free_result ( result ) 
  

488a29a286.png

Any ideas?

Greetings!

Link to comment

First off, I would recommend using the in-built db functions. According to the wiki, this would retrieve a result. However, you're trying to insert data so maybe you aren't supposed to get a return from that. I'm also pretty sure you don't need to free an insert query. Also, you're looking at the structure tab of phpMyAdmin. The browse tab, if the table isn't empty, should look something like this.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...