我有一个 MySQL 数据库,我创建了一个数据库并将其命名为PERSONDB".在该数据库中,我创建了一个表并将其命名为 Person.该表有 3 个字段.id,name,age.
I have a MySQL database, and i created a DB and named it 'PERSONDB'. Within that DB, i have created a table and named it Person. This table has 3 fields. id,name,age.
现在我需要将一些值从我的 flex 网站保存到我创建的 mySQL 'PERSONDB'.
Now i need to save some values from my flex website to the mySQL 'PERSONDB' that i created.
我如何在 Flex (Flax builder 4.6) 中执行此操作
How can i do this in Flex (Flax builder 4.6)
注意:我在 Flex 项目中添加了 2 个字段名称和年龄,当用户单击按钮时,我需要将这些值保存在数据库中.我该怎么做.
Note: I have added 2 fields name and age, in the Flex project and when the user clicks on the Button i need those values to be saved in the DB. how can i do this.
asSQL ( http://code.google.com/p/assql/ ) 是使用 mySQL 的好方法.它允许从 AIR 或基于 Web 的任何应用程序直接访问 mySQL.我在编码中经常使用它,因此我不必编写 Java 或 PHP 作为后端,除非有充分的理由安装后端.
asSQL ( http://code.google.com/p/assql/ ) is a good approach to using mySQL. It allows for direct access to mySQL from any application either in AIR or web based. I use this pretty regularly in my coding so I don't have to write a Java or PHP as a back end unless there is a good reason to have a back end in place.
好的,这是我使用的代码:
OK, here is the code I use:
<assql:MySqlService id ="DB"
hostname ="localhost"
username ="user"
password ="password"
database ="db"
autoConnect="true"
connect ="handleConnected(event)"
sqlError ="handleError(event)"/>
private function getSelectedData() : void
{
DB.send("SELECT * from table WHERE number = '" + number.text + "'");
}
仅此而已.顶部设置连接,位于代码部分.其余部分在 (ActionScript) 部分.当然,也可以直接在 ActionScript 中完成,但是这个解决方案使用了 MXML.
That's all there is too it. The top part sets up the connection and is in the section of the code. The rest is in the part (ActionScript). Of course, it can be done in straight ActionScript as well, but this solution used MXML.
这篇关于使用 Flex 将表单字段保存在 MySQL 数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 for 循环数组
pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合适的
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为