douchao0358 2015-03-13 20:56
浏览 32

Flash Player和mySQL数据库

I created this very simple Counter in Adobe Flash Professional to be displayed on our website. A working example can be viewed here: www.feralcatmonth.com/Spay-Neuter-Counter/

First, I need to get the 2 buttons when they are clicked to insert a row in a designated mySQL Database, which I have created.

There are two tables in the Database (spay_total & neuter_total) with three columns in each table (ip, clicks, datetime). This could easily be accomplished with only 1 row but I wanted to setup 'ip' as the computer's ip address. Clicks is set to auto_increment.

Any help with these issues will be greatly appreciated. Thank you.

enter image description here

EDIT

I managed to get this Flash Player to work with the XML file. The XML displays the last row in the table but only grabs the clicks column from the table. The clicks column is set to auto-increment.

The only issue I have now is how to link the button so once it is pushed it adds a row to the database while also increasing the display box by +1.

I think the code will be something like this in Flash Actions Button:

on (press) {
      INSERT INTO spay_total (ip, datetime) VALUES ('$ip', 'NOW()');
}

But I don't know how to incorporate this into the Flash Player Actions?

As of right now, I do not really care about getting the ip address of the user. I just need to get the button to insert a row into the database, then I will worry about getting the IP address.

Flash Professional Actions Frame (for reference if needed):

{
var theXML:XML = new XML();
theXML.ignoreWhite = true;
theXML.load("http://www.feralcatmonth.com/php-sql/spay_totals.php");

theXML.onLoad = function(success){
if (success){
    spay_counter=this.firstChild.firstChild.firstChild;
    }
  };
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://www.feralcatmonth.com/php-sql/neuter_totals.php");

myXML.onLoad = function(success){
if (success){
    neuter_counter=this.firstChild.firstChild.firstChild;
    }
  }
}

Thank you again.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)