title: Inserting data in MySQL using flex TextInput and Button
body: <p>I am trying to add data to mysql database. There is a single textInput for entering name and a Button.(addBtn) on click of which the textInput.text should be inserted in to the database. The php file is autogenerated from the database. In Button handler i wrote the following code</p>
  
  <pre><code>protected function addBtn_clickHandler(event:MouseEvent):void
  { 
  namBol= new Naming();
  namBol.name=nameTxt.text; 
  createNamingResult.token = namingService.createNaming(namBol);
  }
  </code></pre>
  
  <p>The database has only two feilds, sr_no and name. While running this code, on clicking the addBtn the name does not get inserted into the database. What might be the problem?</p>
  
  <p>Here is the whole code, let me know if I miss something.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark" 
     xmlns:mx="library://ns.adobe.com/flex/mx" 
     xmlns:valueObjects="valueObjects.*" 
     xmlns:namingservice="services.namingservice.*" 
     minWidth="955" minHeight="600" 
  &gt; 
  &lt;fx:Declarations&gt; 
  &lt;valueObjects:Naming id="namBol"/&gt; 
  
  &lt;s:CallResponder id="createNamingResult"  result="createNamingResult_resultHandler(event)"/&gt; 
  &lt;namingservice:NamingService id="namingService" 
         fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" 
         showBusyCursor="true"/&gt; 
  &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt; 
  &lt;/fx:Declarations&gt; 
  
  &lt;fx:Script&gt; 
  &lt;![CDATA[ 
  import mx.controls.Alert; 
  import mx.events.FlexEvent; 
  import mx.rpc.events.ResultEvent; 
  protected function addBtn_clickHandler(event:MouseEvent):void 
  { 
      namBol= new Naming(); 
      namBol.name=nameTxt.text; 
      createNamingResult.token = namingService.createNaming(namBol);   
  } 
  ]]&gt; 
  &lt;/fx:Script&gt; 
  &lt;s:TextInput id="nameTxt" x="216" y="144" /&gt; 
  &lt;s:Button id="addBtn" x="217" y="204" label="Button"   click="addBtn_clickHandler(event)"/&gt;  
  &lt;/s:Application&gt; 
  </code></pre>