Author Topic: MySQL Connect  (Read 4363 times)

0 Members and 1 Guest are viewing this topic.

Offline sk

  • Street Thug
  • *
  • Posts: 6
    • View Profile
MySQL Connect
« on: October 01, 2014, 06:55:19 pm »
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.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: MySQL Connect
« Reply #1 on: October 01, 2014, 07:13:50 pm »
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.

Offline sk

  • Street Thug
  • *
  • Posts: 6
    • View Profile
Re: MySQL Connect
« Reply #2 on: October 02, 2014, 07:29:32 pm »
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..