Sign in to follow this  
Followers 0
McGod

Web Autoit UDF

4 posts in this topic

#1 ·  Posted (edited)

Its a mix of SQLite and Web (Mostly SQLite)

;===============================================================================
;
; Description:    Loads a full HTML page to screen.
; Syntax:          _LoadPage ( $Location )
; Parameter(s):  $Location = full path to the html to load.
; Requirement(s):   None
; Return Value(s):  On Success - Returns 1 and HTML page.
;                  On Failure - Returns 0
; Author(s):        Chipped
; Note(s):          None
;
;===============================================================================

;===============================================================================
;
; Description:    Returns ethier a POST or GET into an array
; Syntax:          _ParseReturns ( $type )
; Parameter(s):  $clean = Enter your POST or GET to parse
; Requirement(s):   None
; Return Value(s):  On Success - Returns an array with POST or GET
;                  On Failure - Returns 0
; Author(s):        Chipped
; Note(s):        None
;
;===============================================================================

;===============================================================================
;
; Description:    Creates an SQLite table
; Syntax:          _CreateTable ( $name, $array )
; Parameter(s):  $name = Name of the table
;                   $array = An array of the columns you want added
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Inserts information into a Table
; Syntax:          _InsertTable ( $name, $array )
; Parameter(s):  $name = Name of the table to put information
;                   $array = An array of the information to put in
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Updates information in a Table
; Syntax:          _UpdateTable ( $name, $column, $data, $RowID = 1 )
; Parameter(s):  $name = Name of the table to update information
;                   $column = Name of the column your updating
;                   $data = Data you want to enter
;                   $RowID = Spot where the information is. Default is 1.
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Deletes a row of information from a table.
; Syntax:         _DeleteTable ( $name, $RowID = 1 )
; Parameter(s):  $name = Name of the table that has the information you wish to delete
;                   $RowID = Spot where the information is. Default is 1.
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Grabs information from a table.
; Syntax:          _GrabTable ( $name, $column, $RowID )
; Parameter(s):  $name = Name of the table that has the information you wish to delete
;                   $column = Column in the table you want the information from. * is a wildcard.
;                   $RowID = Spot where the information is. Default is 1.
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns information
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Deletes a table from the database.
; Syntax:         _DeleteTable ( $name )
; Parameter(s):  $name = Name of the table that has the information you wish to delete
; Requirement(s):   SQLite database loaded, SQLite.dll
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns SQLite ErrMsg and Sets Error to 1
; Author(s):        Chipped
; Note(s):        Must have a _SQLite_Open run before running this.
;
;===============================================================================

;===============================================================================
;
; Description:    Copys & Registers SQLite3.dll
; Syntax:          _InstallSQL ()
; Parameter(s):  None
; Requirement(s):   SQLite.dll in the Script Directory.
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns 0
; Author(s):        Chipped
; Note(s):        None
;
;===============================================================================

;===============================================================================
;
; Description:    Opens a SQLite Database
; Syntax:          _OpenSQL ( $database )
; Parameter(s):  $config = Name of database to load
; Requirement(s):   SQLite.dll installed
; Return Value(s):  On Success - Returns 1
;                  On Failure - Returns 0
; Author(s):        Chipped
; Note(s):        None
;
;===============================================================================

You need SQLite Script installed or use _InstallSQL () but make sure you have SQLite3.dll in the folder.

Any bugs post em.

Web_Funcs.au3

Edited by Chip

Share this post


Link to post
Share on other sites



I think this is what I've been waiting for....

Please post an example!!!

I need to create a database with a table of products: code, description, quantity, price...

and then I need to add, actualize, delete or maque a query of one....

Please!!!

Share this post


Link to post
Share on other sites

_CreateTable ( "products", _ArrayCreate ( "code", "description", "quantity", "price" ))

_UpdateTable ( "products", "quantity", _GrabTable ( "products", "quantity", "1" ) + 1, "1" )

That would create a table called products with columns "code, desc, quantity, price. Then add 1 to the quantity.

Share this post


Link to post
Share on other sites

_CreateTable ( "products", _ArrayCreate ( "code", "description", "quantity", "price" ))

_UpdateTable ( "products", "quantity", _GrabTable ( "products", "quantity", "1" ) + 1, "1" )

That would create a table called products with columns "code, desc, quantity, price. Then add 1 to the quantity.

Thanks :lmao: I'll try later!!!

Share this post


Link to post
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
Sign in to follow this  
Followers 0