MySQL - Connect question
#1

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? ^^
Reply
#2

Yes. However, the IP should be "localhost". Username to connect to the database, database name & database password.
Reply
#3

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.
Reply
#4

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 ?
Reply
#5

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!
Reply
#6

My last question:
Is a good idea to save players' status using .db file which is on same host with server? (in scriptfiles).
https://sampwiki.blast.hk/wiki/Db_open
I would use db_open and other function like db_.... from the link above.
Is a good idea?
Reply
#7

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.
Reply
#8

You didn't answered my question. Is good or not to use .db files with the functions like db_....from this https://sampwiki.blast.hk/wiki/Db_open
Reply
#9

.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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)