Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 874
  • Last Modified:

AS3 and database [ SQL vs MYSQL ]

I was wondering if working with SQL server is different than working with MYSQL.
If it is, how do I connect to a SQL server and read and write to it.

0
Angha110
Asked:
Angha110
  • 7
  • 4
1 Solution
 
dgofmanCommented:
From end user and Flex Developers no diffrences you are using MSSQL or MySQL or DB2 or Oracle ect.
0
 
Angha110Author Commented:
So, I should do the same with the SQL server connection as I do for mysql?
0
 
dgofmanCommented:
You are not connecting to the databse you have to create HTTP connection to your server.
Using RemoteObject (AMF), WebService (SOAP), XMLSocket etc. And on backend implements a database communication.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Angha110Author Commented:
I have been using PHP to access MYSQL and that is the only way I know how,
Could I do the same?
0
 
dgofmanCommented:
0
 
dgofmanCommented:
If you will get access to MySQL in PHP should can transfer data over the internet using AMF, XML or JSON format
0
 
Angha110Author Commented:
XML
0
 
dgofmanCommented:
In this case connect to MySQL
Run query: mysql -uroot --xml -e 'SELECT * FROM TABLE'
(It will generate XML output)
Send this result to the client using HTTP connection
and on the client side convert string to XML
var xml:XML = new XML(str);
0
 
dgofmanCommented:
or you can get result set and create your output.

Example:

http://devzone.zend.com/article/11
0
 
Angha110Author Commented:
In this case connect to MySQL
Run query: mysql -uroot --xml -e 'SELECT * FROM TABLE'
(It will generate XML output)
Send this result to the client using HTTP connection
and on the client side convert string to XML
var xml:XML = new XML(str);

Open in new window


Will you please open this up for me, a little more details so I can do it in my Flash project.

Thanks,
0
 
dgofmanCommented:
You can use at least 10 options retrieve data in PHP using MySQL connection.

For example using this library:

http://www.tonymarston.net/php-mysql/dom.html

or simply create a SQL query (what I used in the past, to avoid marshaling data via result set)

SELECT GROUP_CONCAT('<timezone id="', Time_zone_id, '" offset="', Offset , '" code="', Abbreviation,'"></timezone>' SEPARATOR '\n' ) AS xml FROM `time_zone_transition_type`

And you will pass this string to the Flex on the Flex side using  mx:HTTPService  you will get result as string. You just need to convert to XMLList. “new XMLList(phpResult)”
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now