Drupal Questions & Answers

Ask and answer Drupal related questions! No question too simple or complex!
pyramidea.com's picture
Asked by on Fri 27th Aug 2010
drupal & flash magazine

hello, i’m running a comics website that uses flash to display the node images as a magazine.

the main idea works like that:
1. i upload images in my node
2. in my view i make a link that go to the flash page with variable that hold node id (http://example.com?id=1)
3.flash reads the images from a php file so it can retrieve the images of the node and put it in the magazine.

here is the code that flash file use to get the images:

<?php
require ('db.php');
?>

<?php
$sql
="select * from node where type='comic'";
$id=$_GET[id];
print
$id;


$sqls="select * from content_field_comicpics where nid='$id'";
$ress=mysql_query($sqls);
while (
$rows=mysql_fetch_array($ress)){
$fileid=$rows[field_comicpics_fid];
print
$sqls;
$sqld="select * from files where fid='$fileid'";
$resd=mysql_query($sqld);
while (
$rowd=mysql_fetch_array($resd)){
$path=$rowd[filepath];
}
?>

<?php
 


}
?>

so i discovered something strange happened, if i let the code as shown, flash can’t get the images and nothing displays, if i replace the variable $id with the node number like say (4), everything works fine and as expected. what could be the problem.??!!

Commenting on this Drupal Question is closed.