Posts: 76
Threads: 20
Joined: Jul 2014
Reputation:
0
Hello all! If i upload a .db file on my samp server's host, i can use the mysql_connect function to connect to the same server where the samp server is?
like this:
new mysql = mysql_connect("Here my host ip","ftp username from my samp server","name of my .db file","password of the FTP username from my samp server");
Is correctly what i wrote? ^^
Posts: 845
Threads: 123
Joined: Dec 2011
Reputation:
0
Yes. However, the IP should be "localhost". Username to connect to the database, database name & database password.
Posts: 889
Threads: 4
Joined: Mar 2013
Reputation:
0
If your database server is on the same server as your samp server, you can use localhost. If that does not work, ask your host for the correct settings.
Posts: 76
Threads: 20
Joined: Jul 2014
Reputation:
0
But is correctly if i write my FTP password / username and not the SQL database username / password ?
And...what;s the difference between .db and .sql file ?
Posts: 845
Threads: 123
Joined: Dec 2011
Reputation:
0
Not your FTP details. That's for your website. I'm not sure what the difference is between them. I believe .db is client-side!
Posts: 55
Threads: 1
Joined: Apr 2015
Reputation:
0
I would rather start a MySQL server and use the MySQL database.
And for your SQLite database, make sure it's in your "scriptfile" directory.
Posts: 889
Threads: 4
Joined: Mar 2013
Reputation:
0
.db files are used with SQLite. Yes, you can open .db with db_open which is built into SA:MP.
For a SQLite database, you do NOT need a login name.
Posts: 55
Threads: 1
Joined: Apr 2015
Reputation:
0
That question isn't supposed to be answer as good or bad.
It all depends on many factors, such as "The way you're gonna use them", "What fits your needs" and am not a pro at benchmarking and i don't know which on is better in performances, but you can use it yea. But later you might confront some difficulties and few people will be here to help you along since it's not a common way to use databases, i gave you something to use but as i've seen that's you're question and i hope someone else give a better reply.