rednaxela Posted February 19, 2021 Posted February 19, 2021 Hello, its my first time experimenting with databases. First Im trying to understand and see how works everything so i just copy and paste the example of the UDP. But i cant even start because i got error not connecting to the database. These are the real values of the database no matters if someone login, are from a test account in a website. Later i can delete it and create a new one. here database name: .au3 expandcollapse popup#include "EzMySql.au3" #include <Array.au3> If Not _EzMySql_Startup() Then MsgBox(0, "Error Starting MySql", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf $Pass = "0WJdeYpC0L" If Not _EzMySql_Open("sql111.epizy.com", "epiz_24918214", $Pass, "epiz_24918214_82", "3306") Then MsgBox(0, "Error opening Database", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf If Not _EzMySql_Exec("CREATE DATABASE IF NOT EXISTS epiz_24918214_82") Then MsgBox(0, "Error opening Database", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf If Not _EzMySql_SelectDB("epiz_24918214_82") Then MsgBox(0, "Error setting Database to use", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf $sMySqlStatement = "CREATE TABLE IF NOT EXISTS TestTable (" & _ "RowID INT NOT NULL AUTO_INCREMENT," & _ "Name TEXT NOT NULL ," & _ "Age INT NOT NULL ," & _ "EyeColour TEXT NOT NULL ," & _ "HairColour TEXT NOT NULL ," & _ "PRIMARY KEY (`RowID`) ," & _ "UNIQUE INDEX RowID_UNIQUE (`RowID` ASC) );" If Not _EzMySql_Exec($sMySqlStatement) Then MsgBox(0, "Error Creating Database Table", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf Local $aEyeColours[7] = ["Amber","Blue","Brown","Grey","Green","Hazel","Red"] Local $aHairColours[6] = ["Brown","Black","Blond","Grey","Green","Pink"] Local $sMySqlStatement = "" For $i = 1 To 50 Step 1 $sMySqlStatement &= "INSERT INTO TestTable (Name,Age,EyeColour,HairColour) VALUES (" & _ "'Person" & $i & "'," & _ "'" & Random(1, 100, 1) & "'," & _ "'" & $aEyeColours[Random(0, 6, 1)] & "'," & _ "'" & $aHairColours[Random(0, 5, 1)] & "');" Next If Not _EzMySql_Exec($sMySqlStatement) Then MsgBox(0, "Error inserting data to Table", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf MsgBox(0, "Last AUTO_INCREMENT columnID2", _EzMySql_InsertID()) $aOk = _EzMySql_GetTable2d("SELECT Name,EyeColour FROM TestTable WHERE EyeColour = '"& $aEyeColours[Random(0, 6, 1)] & "';") $error = @error If Not IsArray($aOk) Then MsgBox(0, $sMySqlStatement & " error", $error) _ArrayDisplay($aOk, "2d Array Names of certain eyecolour") MsgBox(0, "", "Following is how to get a row at a time of a query as a 1d array") If Not _EzMYSql_Query("SELECT * FROM TestTable WHERE HairColour = '"& $aHairColours[Random(0, 5, 1)] & "' LIMIT 5;") Then MsgBox(0, "Query Error", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg()) Exit EndIf For $i = 1 To _EzMySql_Rows() Step 1 $a1Row = _EzMySql_FetchData() _ArrayDisplay($a1Row, "Result: " & $i) Next _EzMySql_Exec("DROP TABLE TestTable") _EzMySql_Close() _EzMySql_ShutDown() Exit Btw i think there are some other dll or something like that. Im not sure if i have the correct. I just downloaded everything.
TheXman Posted February 19, 2021 Posted February 19, 2021 (edited) sql111.epizy.com has an unroutable DNS address (192.168.0.161). So there is no way to test it externally using the DNS name. Why would you publish an unroutable IP address on a public name server? Edited February 19, 2021 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
rednaxela Posted February 19, 2021 Author Posted February 19, 2021 32 minutes ago, TheXman said: sql111.epizy.com has an unroutable DNS address (192.168.0.161). So there is no way to test it externally. Why would you publish an unroutable IP address on a public name server? I dont know bro, im new on this.
TheXman Posted February 19, 2021 Posted February 19, 2021 31 minutes ago, rednaxela said: I dont know bro, im new on this. You said that you were new to databases, not networking. In any case, at this point, your issue is not related to AutoIt. Bro! CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
rednaxela Posted February 19, 2021 Author Posted February 19, 2021 Just now, TheXman said: You said that you were new to databases, not networking. In any case, at this point, your issue is not related to AutoIt. Bro! well my first time trying to connect to mysql and see if i can get some values from there. any experience even with php
rednaxela Posted February 19, 2021 Author Posted February 19, 2021 There Is any full example and explained from zero for dumbs like me.
TheXman Posted February 20, 2021 Posted February 20, 2021 (edited) MySQL databases created on free web hosting sites (like epizy.com) are usually for internal access by web sites that you host on their servers like bulletin boards or web sites with dynamic content. They usually do not allow general access from external connections. Epizy may be different but I doubt it. I'm sure they have FAQ's or a knowledgebase for you to read more about it. Good luck! ** Update ** As I thought, this link came from the epizy knowledgebase: https://support.infinityfree.net/mysql/connecting-to-mysql-from-elsewhere/ Edited February 20, 2021 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
rednaxela Posted February 20, 2021 Author Posted February 20, 2021 30 minutes ago, TheXman said: MySQL databases created on free web hosting sites (like epizy.com) are usually for internal access by web sites that you host on their servers like bulletin boards or web sites with dynamic content. They usually do not allow general access from external connections. Epizy may be different but I doubt it. I'm sure they have FAQ's or a knowledgebase for you to read more about it. Good luck! ** Update ** As I thought, this link came from the epizy knowledgebase: https://support.infinityfree.net/mysql/connecting-to-mysql-from-elsewhere/ Its good to know about that. Well i will need research more there say its possible with php scripts or buying the premiun 3 usd.
rednaxela Posted February 21, 2021 Author Posted February 21, 2021 On 2/19/2021 at 6:08 PM, TheXman said: MySQL databases created on free web hosting sites (like epizy.com) are usually for internal access by web sites that you host on their servers like bulletin boards or web sites with dynamic content. They usually do not allow general access from external connections. Epizy may be different but I doubt it. I'm sure they have FAQ's or a knowledgebase for you to read more about it. Good luck! ** Update ** As I thought, this link came from the epizy knowledgebase: https://support.infinityfree.net/mysql/connecting-to-mysql-from-elsewhere/ Hey bro, which provider can give me this access? I will buy it!! I already tested with others and can not connect.
Skysnake Posted February 22, 2021 Posted February 22, 2021 Start with SQLite (https://www.autoitscript.com/autoit3/docs/libfunctions/_SQLite_Query.htm) and then migrate to bigger DBs. You first need to understand SQL, and then the web interface. The problem in the first post is a connection issue, nothing to do with actual SQL. SELECT myproblem FROM tblproblem ORDER BY 1 DESC; PS, you will need to download SQLite separately. Skysnake Why is the snake in the sky?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now