Writing to a MYSQL database

Got a problem you cannot solve? Try here.
Post Reply
Austin
Posts: 20
Joined: Tue Mar 11, 2008 4:54 pm

Writing to a MYSQL database

Post by Austin »

I am using the MYSQL plug in and its a bit confusing. Hope someone here can lend a hand.

The server is NOT a local machine but is instead on my web sites server. I have entered the IP address, port, password. Not certain about the user name being needed as I don't use it when I write to it from one of my PHP pages.

The issue I am looking at is how to write the SQL scripts. I need to:

1. Connect to the correct data base
2. Select the correctdata base
3. Write values I have in InstallAware Variables to the correct tables in the database.
4. Disconnect from the database.

Any help or documentation would be MOST appreciated.
Austin
Posts: 20
Joined: Tue Mar 11, 2008 4:54 pm

Re: Writing to a MYSQL database

Post by Austin »

Austin wrote:I am using the MYSQL plug in and its a bit confusing. Hope someone here can lend a hand.

The server is NOT a local machine but is instead on my web sites server. I have entered the IP address, port, password. Not certain about the user name being needed as I don't use it when I write to it from one of my PHP pages.

The issue I am looking at is how to write the SQL scripts. I need to:

1. Connect to the correct data base
2. Select the correctdata base
3. Write values I have in InstallAware Variables to the correct tables in the database.
4. Disconnect from the database.

Any help or documentation would be MOST appreciated.

Or alternately, is there a way via script to simply send a string to my existing PHP page located on my web site?
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Austin,

These are all standard things that can be done with any flavor of SQL Scripting. I would suggest you check the MySQL docs.

In MS SQL:

Use [dbname]
If the record already exists:
Update mytable set myfieldname1 = mynewvalue

If the record does not exist:
Insert into mytable (fieldname1,fieldname2) values (myvalue1,myvalue2)

These are not things that really pertain to InstallAware, hope this helps.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Austin
Posts: 20
Joined: Tue Mar 11, 2008 4:54 pm

Post by Austin »

jimo wrote:Austin,

These are all standard things that can be done with any flavor of SQL Scripting. I would suggest you check the MySQL docs.

In MS SQL:

Use [dbname]
If the record already exists:
Update mytable set myfieldname1 = mynewvalue

If the record does not exist:
Insert into mytable (fieldname1,fieldname2) values (myvalue1,myvalue2)

These are not things that really pertain to InstallAware, hope this helps.
Jim I appreciate the feedback but I can't even get InstallAware to connect to the database. :D
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Or alternately, is there a way via script to simply send a string to my existing PHP page located on my web site?
Yes,

Set Variable PRODUPDATE_INI to http://mywebsite.com/cgi-bin/product_up ... n=$VERSION$

Download File $PRODUPDATE_INI$ into $SUPPORTDIR$\\updated.txt (get result into variable UPDATED_GET_INI)
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Austin
Posts: 20
Joined: Tue Mar 11, 2008 4:54 pm

Post by Austin »

jimo wrote:
Or alternately, is there a way via script to simply send a string to my existing PHP page located on my web site?
Yes,

Set Variable PRODUPDATE_INI to http://mywebsite.com/cgi-bin/product_up ... n=$VERSION$

Download File $PRODUPDATE_INI$ into $SUPPORTDIR$\\updated.txt (get result into variable UPDATED_GET_INI)
Jim I am totally confused by your post, I need to UPLOAD to my page. What am I misunderstanding here?
Post Reply