Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 18:22
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  MySQL, PostgreSQL, MS SQL, Access (Moderators: Flash-db, Musicman, Ronald Wernecke, Jorge Solis, Andries Seutens)
| | |-+  Smart way to fill the data grid component from Tim K Chung?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Smart way to fill the data grid component from Tim K Chung?  (Read 1219 times)
Thomas
Server what's that
*
Posts: 14



View Profile Email
« on: 10/26/02, 18:09 »

I am trying to fill the data grid component from Tim K Chung, with values coming from my SQL server...

Flash code:
Code:
rc = new RecordSet(["ID","firstname", "midname", "lastname"]);
loadVariablesNum ("Grid.php?AantalRijen="+AantalRijen, "0");


for(i=0;i<=AantalRijen;i++){
loadVariablesNum ("Grid.php?Thefirstname[i]="+Thefirstname[i]+"&Themidname[i]="+Themidname[i]+"&Thelastname[i]"+Thelastname[i]+"&TheID[i]="+TheID[i], "0");

rc.addItem({ID:TheID[i], firstname:Thefirstname[i], midname:Themidname[i], lastname:Thelastname[i]});
}

This doesn't work  Sad

With this PHP code:

Code:
<?php

// Variabelen
require 'include.php';


// Inloggen database
$conn=mysql_connect($DBhost,$DBuser,$DBpass);
mysql_select_db("$DBName");

if(
mysql_errno()){
   echo 
mysql_errno().": ".mysql_error()."\n";
   exit;
}

$result mysql_query("SELECT *FROM $table");
$numRows mysql_num_rows($result);

print 
"AantalRijen=$numRows&";


while(
$Namen mysql_fetch_row($result))
   print 
"TheID[$Namen[0]]=$Namen[0]&Thefirstname[$Namen[0]]=$Namen[1]&Themidname[$Namen[0]]=$Namen[2]&Thelastname[$Namen[0]]=$Namen[3]";
   
mysql_close($conn);

?>


I don't think this is the fastest way reading value for value...
Does somebody know a fast way to fill the grid with arrays?

Thanx!!!
« Last Edit: 10/27/02, 11:18 by Thomas » Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!