Page 1 of 1
Writing to a MYSQL database
Posted: Tue Mar 25, 2008 2:50 pm
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.
Re: Writing to a MYSQL database
Posted: Tue Mar 25, 2008 2:51 pm
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?
Posted: Tue Mar 25, 2008 2:55 pm
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.
Posted: Tue Mar 25, 2008 3:11 pm
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
Posted: Tue Mar 25, 2008 3:22 pm
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)
Posted: Thu Mar 27, 2008 4:59 pm
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?