PDA

View Full Version : Flex + PHP + Mysql


rodrigoalex
06-17-2009, 11:47 PM
Hi's it going?

I am creating an application with Flex and I am a great problem to recover the data as the database, I do not know what to do. I am using to connect to a PHP generating XML in PHP (the code is below), but I do not know how the recovery in the FLEX, tried with the mx: HTTPService, but it returns an error (and error codes follow below).

file ntc.php:

<?php

require_once("con.php");

$mysql_select = "SELECT * FROM projntc";
$mysql_query = mysql_query($mysql_select);
$mysql_array = mysql_fetch_array($mysql_query);

$ntc = "<boardntc>";
$ntc .= $mysql_array['title'];
$ntc .= "</boardntc>";

echo($ntc);

?>

flex :

<mx:HTTPService id="ntc" url="{ntc.php}" >
<mx:Label x="10" y="30" width="112" id="tituloNtc" text="{boardntc}"/>
</mx:HTTPService>

erro:


Parse error at '<mx:HTTPService>'.

rodrigoalex
06-18-2009, 12:37 AM
I found the answer, if someone has the same problem, send a message directly to me that explains how to resolve!

StrangeParadise
06-20-2009, 09:29 AM
Hello rodrigoalex,

If you want to know all the sides of this technique, there a great tutorial that explains how to use the HTTPService components with Flex, AS3, PHP and SQL (http://www.onitan.com/tutorial/example/using-httpservice-components-with-flex-as3-php-and-sql/).

I hope it will help you :p