Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2008, 08:38 PM
Junior Member
 
Join Date: May 2008
Posts: 2
Default database question (maybe useful for newbies)

OK, Hello!
I have a code written in PHP, and I use it normal in my simple project:
Code:
mysql_select_db("childroom", $connneeect);

$result = mysql_query("SELECT reg_num as ron, modelsa as mo FROM dolls");
$num_results = @mysql_num_rows($result);


echo "<table border='1'>
<tr>
<th>Number</th>
<th>DollModel</th>
</tr>";


for ($i=0; $i <$num_results; $i++){
$row = @mysql_fetch_array($result);
 echo "<tr>";
 echo "<td>" . $row['ron'] . "</td>";
 echo "<td>" . $row['mo'] . "</td>";
 echo "</tr>";
 }
echo "</table>";

mysql_close($connneeect);
My question is: Is it possible to make the same using SWFKit?
I mean, how we can create... maybe some grid? ???

Is it something like this (from the forum):
Code:
while (!record.eof)
  {
    trace(record.Fields(0).Value.toString());
    trace(record.Fields(1).Value.toString());
    trace(record.Fields(2).Value.toString());
    trace(record.Fields(3).Value.toString());
    trace(record.Fields(4).Value.toString());

    record.moveNext();
  }
?
And how can I write the whole in one place (in one table, in one grid or something other)?

Thank you, and I'm sorry for posting non-AS code. Just my competence is a little different.
I hope, the answer would be useful for every newbies like me
Maybe some of them have the same questions.
Reply With Quote
  #2 (permalink)  
Old 05-15-2008, 12:33 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: database question (maybe useful for newbies)

Yes, your code is right. You can try the following sample.
http://www.123flashchat.com/forum/in...02.0;attach=81

To connect to a mysql database, you just need to specify the proper connection string, which can be found in the following post
http://www.123flashchat.com/forum/index.php?topic=489.0
Reply With Quote
  #3 (permalink)  
Old 05-15-2008, 01:37 AM
Junior Member
 
Join Date: May 2008
Posts: 2
Default Re: database question (maybe useful for newbies)

Thanks,
I'm a little confused of using ffish script (it look like it's easy, but for first time hmmm...it's not for me )

Today first I was trying to put all data results in dynamic text field. And my question was near to.. how to get all results (hundreds rows in a table)
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:13 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.