Jump to content

MySQL UDFs


cdkid
 Share

Recommended Posts

[uPDATE]

Version 1.1

Added _GetTblNames()

1/30/06 11:27

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Hey guys got a Question. I am interested in mysql but don't know what it is. Is it basicly a online excel spreadsheet??? if so I could definetly use this. Please explain, anyone ;)

Well what it is is a database program. You create a DB then add in tables, then columns. umm... i cant really think of a way to explain this. It's very useful for logging into a website because u could have a database called i dunno 'login' and in there u have a table called 'logindata' and in there u have columns 'username' and 'password' when people register they fill out a form then it sends the info in the register form to the database then when they log in u check the username and password against it... i hope this helps, and if u do anything that might require a DB of any sort i definitly recommend MySQL

if u have any other questions or if i didnt explain this very well just ask.

by the way when you look

for a smiley do you ever

make the face yourself then

look for that face. lol...

yes :lmao: hehe

~cdkid

oh and the website is www.mysql.com

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Well what it is is a database program. You create a DB then add in tables, then columns. umm... i cant really think of a way to explain this. It's very useful for logging into a website because u could have a database called i dunno 'login' and in there u have a table called 'logindata' and in there u have columns 'username' and 'password' when people register they fill out a form then it sends the info in the register form to the database then when they log in u check the username and password against it... i hope this helps, and if u do anything that might require a DB of any sort i definitly recommend MySQL

if u have any other questions or if i didnt explain this very well just ask.

yes :lmao: hehe

~cdkid

oh and the website is www.mysql.com

Thanks so much, I know MySql. I love it now. I would check out this tutorial it you don't know how to use MySql. The only hard part was finding a good host. i use www.freesql.org and use my www.t35.com account to access my database. I can't wait to use your UDFs. I want to try it on my ControlMe.au3 script

Thanks Again

-zero

I have tested the UDFs and I get an error, I have a feeling it is the driver. I don't know eactly about that but, do I download a driver from ]http://dev.mysql.com/downloads/ I'm not sure please help

this is the http://zerocool60544.t35.com/error.bmp

Edited by zerocool60544
Check out ConsultingJoe.com
Link to comment
Share on other sites

just do a google search for "MYSQL ODBC DRIVER DOWNLOADS" and uhhh u can host ur own mysql db if u have World Wide Web publishing enabled u can put it on your localhost account

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

FIX

Fixed problems with updating records with numbers

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Hi,

All good work;

Is it too late to ask you to adjust your naming?

_MySQL_AddRecord()

etc?

randall

[You still have no example scripts/ browser view written?]

Edited by randallc
Link to comment
Share on other sites

i dont see why i should rename it _MYSQL_Addrecord because then it's just longer and i prefer shorter lines of code :lmao:

and there are examples in post #2... i am working on a GUI right now that will show u your tables & columns but u should just get the MySQL administrator if u want some kind of 'browser view'

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

1. do u have a server up

2. are you logging in with the right credentials?

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

I try to run configuration and I get "can't start mySQL" error 0

This is the server configuration; I thought that was supposed to start up the database server (is that what you mean by "server up" - this is just on a local machine)

This is where I put in the start up password etc! - where else?

This is not ambitious; I just want to be able to start a single instance of a server, and run the sampledb?

randall

Edited by randallc
Link to comment
Share on other sites

This is the server configuration; I thought that was supposed to start up the database server (is that what you mean by "server up" - this is just on a local machine)

randall

MaSQL is a full blown database server and not embedded like SQLite. The MySQL Server has to be already running for a connection attemp to work. That is why _MySQLEnd seems to be needed, because this way the connectin to the database server (running on the local machine or a remote computer) is closed properly.

I have no standing in this forum, but I think finding a naming convention for SQL related user defined functions is important. Both the mysql and the sqlite UDF add important functionality to autoit and should be able to coexist. In fact, what would be really, really good, would be a UDF that offers a generic interface for basic database functions and that can interface with several different databases at the backend. But I don't have the ability nor the desire to implement something like this. :lmao:

The mysql stuff is for people wanting to access a remote database over the internet/intranet and the sqlite stuff is for including a lean and mean database engine in your local programs. My needs are firmly in the mean and lean camp right now.

Here is the articel I used to get a mysqlserver up an running when I was playing with rails, it should help you to get mysql runnig easily. I don't have a link for myodbc handy, sorry

Edited by Procedural
Link to comment
Share on other sites

Thank you for a thoughtful and thought provoking response.

Gene

MaSQL is a full blown database server and not embedded like SQLite. The MySQL Server has to be already running for a connection attemp to work. That is why _MySQLEnd seems to be needed, because this way the connectin to the database server (running on the local machine or a remote computer) is closed properly.

I have no standing in this forum, but I think finding a naming convention for SQL related user defined functions is important. Both the mysql and the sqlite UDF add important functionality to autoit and should be able to coexist. In fact, what would be really, really good, would be a UDF that offers a generic interface for basic database functions and that can interface with several different databases at the backend. But I don't have the ability nor the desire to implement something like this. :lmao:

The mysql stuff is for people wanting to access a remote database over the internet/intranet and the sqlite stuff is for including a lean and mean database engine in your local programs. My needs are firmly in the mean and lean camp right now.

Here is the articel I used to get a mysqlserver up an running when I was playing with rails, it should help you to get mysql runnig easily. I don't have a link for myodbc handy, sorry

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

Hi,

thanks for that, @procedural..

I re-installed mysql and next time it gave me the error, I just hit "retry" and it worked!

Go figure...

i agree with your thoughts.. if you have any contribution to the "lean and mean" let me know.

the reason I stuck with dos wrap of sqlite3.exe was interim; I couldn't work out a way with the sqlite obj approach [@ptrex,@blink324] [nor @piccaso's dll] to do a bulk file csv import nor a rapid bulk text/csv write which I needed for the GUI.

I would switch it all over and just use the same names if I could find another way;

Best, Randall

[PS I had not used SQL before at all, and very much still learning and taking on suggestions to try them out]

Edited by randallc
Link to comment
Share on other sites

Hi @cdkid

I have the localhost working for your example 3, (though I had to move the endif in addrecord) but not the others.

Does the createTable give correct number of columns when you use it with the array input?

Or are you using a pre-existing table?

best, Randall

[has MySQLv 5 changed the need to declare the columns before the insert?]

INSERT INTO testtable (col1,col2,col3,col4) VALUES('col1','col2','col3','col4');

ERROR 1054 (42S22): Unknown column 'col1' in 'field list'

Edited by randallc
Link to comment
Share on other sites

well

your problem is your using _AddRecord when u should be using _CreateColumn

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Hi,

Perhaps i misunderstood;

this was your example script I was testing; I presumed it would have any necessary columns added already so it would not crash - else how can I run it as an example?

i can add the columns first, too, but that is not the point, is it?...

Best, randall

PSI would have made the createtable more like mine in sqlite udf; acceptnig all the column names at creation; is that not possible with the mysql create table too?

Link to comment
Share on other sites

no, the example is for use if u have already connected to a db with the tables & columns... that's why it's just an example of how it would be used, i thought that was pretty clear

and the reason i didnt allow all columns on creation is because i havent had time... i have a lot of homework lately, i work on this when i can.

~cdkid

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

[uPDATE]

added _GetColVals()

P.S.

sorry i havent had much time to write these... been busy, i'll do this whenever i can

~cdkid

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Hi,

Thanks for your effort..

I'l try to get some time myself to do some if I can..

I have fuond out MySQL has the funcs I was asking about for csv;

1. LOAD DATA LOCAL INFILE 'FILENAME' INTO TABLE ... IGNORE 1 LINES ;[does the import of a csv]

2. SELECT...... INTO OUTFILE 'filename'

FIELDS TERMINATED BY ',' ESCAPED BY \' FROM table;

- not sure if they are available in the obj version....

Randall

Edited by randallc
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...