VC:MP 0.4 (Beta) > Script Discussion

MySQL Connect

(1/1)

sk:
i wanted to use mysql database managed by phpmyadmin on my server.After connecting mysql plugin i used
OnScriptLoad(){
some of my own shity functions and then
mysql_connect("localhost","root","Sk",NULL);
}
so
localhost = my Server
root = my username(on sercver)
Sk = my database
NULL = password which in this case is not present
but after loading the executable file it says invalid argument.
this mysql_connect(); function is taken from php i don,t know how can i connect MySQL database i know that function mysql_connect works but i don,t know the exact arguments of this functions in squirrel so can any one can please tell me the how can i use this function in my 0.4 server.
Note = i m just testing my server in localhost (xampp).
so can any one tell me how can i connect my[ ;) ] MySQL database in my server.

thijn:
mysql_connect(server, user, pass, database)

Having no password is a bad idea. Just use phpmyadmin to create a new user with a password and only give it access to your server database. Thats like 10 seconds work, and a LOT more secure.

sk:
Thankx thijin problem solved
and about no password Like i said i am testing it on my localhost server(xampp) so no need for pass thankx for the help..
locked..

Navigation

[0] Message Index

Go to full version