Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

MySQL Library functions


  • Please log in to reply
66 replies to this topic
SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006
@Guest2

Virgus?... Is that you?

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007

This is super cool, any chance of a demo app to see it in action


Per your request I added a simple working demo (see first post).

Smikkelsen Not signed in
  • Guests
  • Last active:
  • Joined: --
Hey, I noticed that you really haven't gotten a lot of feedback on your functions. I just wanted to let you know that I use them daily for a number of things.

I have my phone post to a php page I created when I receive texts, which in turn saves to a database after validating the token. On the other end, my computer is checking this database frequently. Upon finding a new text, it pops up on my screen with the text and sender info. I can also reply from my computer. All possible from this library and AHK (and a few other things on my phone end.)

That is one example of the many things I am using your library for. Just wanted to give you some credit for your awesome work!

Hope everyone else is finding them as useful as me.

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007
THANKS!

This library is reliable and easy to use. But, lately I've been working with IsNull to test and improve his OOP version of mysql library. I think his library is the future for mysql in AHK. It has recordset support, true objects, and supports both mysql and sqlite.

http://www.autohotke...der=asc&start=0

He still needs to fix some bugs and make some improvements in error handling, so for now, my library is the more stable recommendation.

capbat
  • Members
  • 191 posts
  • Last active: Feb 08 2017 06:57 PM
  • Joined: 29 Nov 2007
Hi All

I just phoned my Service Provider, my database is located on a Web Server. While I was asking him about my specifics Host Name etc etc he mentioned to me that my project would be difficult because they do not authorize outside input or communication to their database. It has to come from their server (IP). So he said that he doubt if my script would be able to communicate with the DB! One thing he proposed was that my script could be on their server, then it could be possible.

What is your thoughts or impression on this could the script be hosted?

Tks

Bat

VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006
@capbat: I believe web hosts provide a database specifically for dynamic web content (like these forums) and that you can very easily write a PHP or ASP script (that you invoke via HTTP) to forward queries to your online database.

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007
I guess it depends on what kind of app you are creating and who will be using it.

Are you building a web app or a stand alone app?
Does the app have many users?
Are the users located in 1 office or multiple offices on the same network or different networks?
Are the users anyone on the web?
What kind of application is it and what will it do?

capbat
  • Members
  • 191 posts
  • Last active: Feb 08 2017 06:57 PM
  • Joined: 29 Nov 2007

I guess it depends on what kind of app you are creating and who will be using it.

Are you building a web app or a stand alone app?
Does the app have many users?
Are the users located in 1 office or multiple offices on the same network or different networks?
Are the users anyone on the web?
What kind of application is it and what will it do?


Hi tks for your reply.

@panafish
- No it is not a web app it is a Stand Alone.
- Single user (me)
- Just me Home.
- No
- An Ahk And I just want to scan my DB and look at a specific table and and a specific field and download a list of that table.

Tks.

Bat

capbat
  • Members
  • 191 posts
  • Last active: Feb 08 2017 06:57 PM
  • Joined: 29 Nov 2007

@capbat: I believe web hosts provide a database specifically for dynamic web content (like these forums) and that you can very easily write a PHP or ASP script (that you invoke via HTTP) to forward queries to your online database.


Tks VxE

No I am not in PHP or ASP. But if AHK could be a 'Web Content' ????
Ie: An AHK App on the web forwarding queries to my DB!!!


Bat

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007
Using this mysql library to connect to a remote server would be the same as trying to use the awesome product heidisql to connect and is possible, but depends on port 3306 being open.

This is a good article on this topic:
http://www.thegeekst...ent-connection/

jcrashmiller
  • Guests
  • Last active:
  • Joined: --
I'm trying to use the LIKE modifier in a SELECT query rather than the =. When running the query in phpmyadmin or the console, I get the expected result. When using the same query with your library in AHK, I get null result. Any idea what may be happening?

Thanks for such an awesome addition to AHK.

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007
I use 'like' all the time without any problem.
I'm guessing that you are forgetting that the 'like' wildcard will get confused with ahk's use of the percent symbol and you must escape with a backtick:

select count(*)
from mytable
where name like '%myvariable%`%'


jcrashmiller
  • Guests
  • Last active:
  • Joined: --
Thanks for the quick reply. That was it. However, I have since found a more reliable query that doesn't use LIKE. But there is one other strange thing:

When I first copy the library to the libraries folder in the AHK directory and then try to use the mysql library from within an AHK script, I get an error like the following:

"Cannot find libmysql.dll in C:\Users\CrasH\Apps\Roaming Data\the name of my script'

Sure enough, that folder comes into existence when I first try to run my script. Manually copying the dll file to the folder solves the issue, but it means the first run, every time, for every new script, does this. Thoughts?

panofish
  • Members
  • 179 posts
  • Last active: Apr 24 2014 03:24 PM
  • Joined: 05 Feb 2007
There is a line of code in the library function something like this:

FileInstall, libmysql.dll, %libmysql%, 0

It is intended to copy the libmysql.dll to a shared location when the user runs the program.
The programmer can run the program through the interpreter (run the ahk program), because the libmysql.dll should be in the local directory.
But, the end user will run a compiled version (.exe) of the application and the fileinstall command will embed the libmysql.dll inside the exe and place it in the users appdata folder at run time.
That is where the application looks for the dll.

Maybe you have a uniquely different setup on your machine, but I have run this on many other computers without a problem.

jcrashmiller
  • Guests
  • Last active:
  • Joined: --
Thanks for the quick response. Understanding how that works will help me on my end. Given that I am using my system (and your library) to make a video game console, my setup may in fact be unique. I'll look into it.