1 Reply Latest reply on Jul 28, 2014 6:54 AM by kglad

    how to make a button to search something in sql


      I am trying to make a button that can search for something like for example if like say i type yes, it will show me things that is under yes.But I am not sure how to make the code work as I cannot change the php code as it is under the requirement that I make the button work and not using the php code to make it work which means that I cannot type the yes to show the information and the button must somehow have the "yes" in the function to show the information.Please help me and Thanks for your help.

      This is my flash code.

      package  {


        import flash.display.MovieClip;

        import flash.net.NetConnection;

        import flash.net.Responder;

        import flash.events.MouseEvent;


        public class main extends MovieClip {


        var gateway:NetConnection;

        var responder:Responder;


        public function main() {


        gateway = new NetConnection();


        responder = new Responder(OnPass,OnError);





        function doAvailable(evt:MouseEvent):void





        function OnPass(res:Object):void


         var i:int;



        for (i=0;i<res.length;i++)






        function OnError(res:Object):void










      .This is the code for the php code that works because I already tested it out because it allows me to type yes and it shows me the required information that I need and it is not tested on flash cs6 but on local host things that allows me to test it out.

      function getBooksAvailable($avail)



        $sql = "SELECT title as 'Book Title', author as 'Author', price as 'Price', available as 'Available'

        FROM tblbookinventory

        WHERE available ='" . $avail . "'";

        $result = mysql_query($sql, $this->_connection);

        $rows = array();

        while($row = mysql_fetch_array($result, MYSQL_ASSOC))


        array_push($rows, $row);


        return $rows;