Re: Showing high and low flash clips
| From: | Boyan Nedkov | Date: | Tue, 04 Nov 2003 01:01:52 +0000 |
| Subject: | Re: Showing high and low flash clips | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168429@lists.php.net to get a copy of this message | ||
Suppose we have a recordset $rs returned by query like that:
SELECT mediaID, filename, languageID
FROM yabady a
INNER JOIN yohoho b on a.ID = b.ID
ORDER BY mediaID
then to build the array you can write:
for ($i = 0; $i <= $rs->getRowCount() - 1; $i++) {
$row = $rs->getRow();
$data = array('mediaID' => $row['mediaID'],
'filename' => $row['filename'],
'languageID' => $row['languageID']);
}
Haven't tested it, but have a similar code in one of my scripts here that works fine.
Boyan
--
daniel@electroteque.org wrote:
> Hi there, i'm stumped on a problem, i am trying to create an admin tool,
> which will database files which are ftp'd to the server first. A drop down
> list of flash files are viewed, and they are seperated into high and low
> clips with a language key joined to them. They are stored in the database
> like:
>
> mediaID filename languageID bandwidth
>
> What i am having problems with is that when editing the record, i would
> like to list each with both a high and low pulldown with a language list,
> although there is an issue here as each clip has its own entry into the
> database so its coming out sequentially and i would like it showing the 2
> drop downs and the language joined to these. The issue is storing the
> primary key of these files, so when i hit update it will update each file
> record.
>
> So when abstracting the data, i am trying to push both files into an array
> with a language. I want it to look like
>
> Array
> (
> [0] => Array
> (
> [0] => Array
> (
> [mediaID] => 3
> [filename] => news_hi.swf
> [languageID] => 1
> )
> [1] => Array
> (
> [mediaID] => 4
> [filename] => news_lo.swf
> [languageID] => 1
> )
> )
>
> [1] => Array
> (
> [0] => Array
> (
> [mediaID] => 3
> [filename] => news_hi.swf
> [languageID] => 1
> )
> [1] => Array
> (
> [mediaID] => 4
> [filename] => news_lo.swf
> [languageID] => 1
> )
> )
> )
>
> How is it possible ?
>