Jump to content

Basic MySQL


JohnOne
 Share

Recommended Posts

I'm trying to connect to a mysql database, I've never used a database in my life, but I did make one in cpanel, where a pal of mine let me use his website for testing.

Its not happening though

#include 'mysql.au3'

$sUsername = "user"
$sPassword = "Pass"
$sDatabase = "test"
$sServer = "188.65.112.***" ; there are digits here in code

$sql = _MySQLConnect($sUsername, $sPassword, $sDatabase, $sServer)
MsgBox(0,"",@error) ;=============================================== 2
If IsObj($sql) Then
    MsgBox(0, "", "Yay")
Else
    MsgBox(0, "", "Boooo");========================================= this
EndIf

I've probably gotten something basicaly incorrect, or missed something out.

Can anyone help me?

EDIT:

Im unsure where the @error 2 comes from as it seems the function "_MySQLConnect" sets error to 1

EDIT2:

I've installed Mysql so I think I have the relevant drivers installed, but not certain how I would know for sure.

EDIT3;

Perhaps its a firewall issue, what would I have to allow if it were?

EDIT4:

I have added the wildcard "%" to Remote Mysql in cpanel, and from what I have read, this opens port 3306.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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