Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

retrieve list from a SQL database and create links for each lines in AS3

$
0
0

I'm trying to do an AIR app with these conditions :

I've got a SQL database. In my table there is a "categories" column (with differents categories (computer, books..etc)).

enter image description here

In my AS3 I manage to retrieve "theDescription" when the user choose a categorie. With the URLMethod and a php file.

   // create SQL $sql ="SELECT * FROM annonces where categorie = '$categorie'";

$sql_result = mysql_query($sql, $connection)ordie("Couldn't execute query.");

$num = mysql_numrows($sql_result); $phptheDescription ="";

$counter =0;

while($row = mysql_fetch_array($sql_result)){

$theDescription = $row["theDescription"];

$phptheDescription = $theDescription;

}

echo  "phptheDescription=". $theDescription;

 

So my AS3 code is retrieving the $phptheDescription from the php and displays it in a output_txt

 

Problem : in my output_txt, only ONE "theDescription" is displayed. But I have TWO items in the categorie "Informatique" (and I can have 100 items in the same categories).

 

How do I do to display all "theDescription" that are in the same categories ?

 

Ex: If I choose "Informatique", it should display "Une Surface Pro 3" and "Un IMAC". But it only displays the last item "Un IMAC".

 

And, after that, is it possible to create "links" for each item displayed ?

 

Here's 2 shorts videos (20 sec) explaining my problems :

 

https://vid.me/DS2r

 

http://sendvid.com/6iesrygk

 

Thx


Viewing all articles
Browse latest Browse all 2954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>