Jump to content

combo quirk


jagguy

Recommended Posts

Hi,

I have yet another quirk with php/flash. When i chose a value from the combo list it fails to return any records from the list.

Now here is the quirk, it only happens when i chose the last value of a combo list in flash to send to the php file. So I add another choice to the combo list and the 2nd last value works as expected but again not the last. THIS really has happens and i am really really sick of little time consuming quirks like this .
Natuarally this works fine on my localhost.


---
send_lv.alName=combo1.value; //last value never works
      send_lv.offset=offset;
      send_lv.pageNo=1;
      send_lv.sendAndLoad("http://jagguy.ej.am/flash/snlCombo2.php", nameVars, "GET");
     
---
<?php


include("dbconnect.php");

//$alName="photo1";
error_reporting(0);

$alName=$_GET['alName'];
$offset=$_GET['offset'];
$pageNo=$_GET['pageNo'];

$startoffset=0;
$startoffset=$offset*($pageNo-1);

$sql4="select id from album where Name='$alName' ";
$result4 = mysql_query("$sql4")    or die("Invalid query: " . mysql_error());
$nt2=mysql_fetch_array($result4) ;
$alNum=$nt2['id'];



$sql = "SELECT * FROM image2    WHERE (del !='deleted' or del is null)
    and    albumId='$alNum' ORDER BY id DESC LIMIT $startoffset, $offset";
//$sql = "SELECT * FROM image2    WHERE (del !='deleted' or del is null) and    albumId!='99' ";

$result = mysql_query($sql)    or die("Invalid query: " . mysql_error());

//echo mysql_num_rows($result);

if (mysql_num_rows($result)==0)
{
  echo "<br><br>Nothing to display from photoAlbum :".$alName;
  echo  "<br> <a href='viewPhoto.php'>Display more photos </a> ";
}
else
{
  $i=1;
  //$nt=mysql_fetch_array($result) ;
  while($nt=mysql_fetch_array($result))
  {
    $file[$i]=$nt['filename'];
    $i++;

  }

}
$total=0;
$total=$i-1;
$filestr="";

for($j=1;$j<$total;$j++)
{
  $filestr=$filestr.$file[$j].",";

}
$tt="qqq";
$sql = "SELECT * FROM image2    WHERE (del !='deleted' or del is null)
    and    albumId='$alNum' ";

$result = mysql_query($sql)    or die("Invalid query: " . mysql_error());


$totalrec=mysql_num_rows($result);
mysql_close($link);

//need to add last file on its own
$filestr=$filestr.$file[$total];
//$files="files=".$filestr."&totalrec=".$totalrec."&pageNo=".$pageNo."&alName=".$alName;
$files="files=".$filestr."&totalrec=".$totalrec."&pageNo=".$pageNo;


echo $files ;



?>
Link to comment
https://forums.phpfreaks.com/topic/36056-combo-quirk/
Share on other sites

Hi,

I think i ned to add this for future reference for other peope. Flash/php integration is very messy full of quirks. They don't work well together and you should only do simple stuff. My localhost works fine but take that to a remote host and that's where the fun starts.



in the php file getting the last value means setting a dummy value otherwise non-readbale chars are added. Not on my localhost though.

$files="files=".$filestr."&done=".$pageNo;

NOT $files="files=".$filestr.; which is what i had.

also if you want to overwrite a file on remore server upload the swf and html as well with a new file name , because it won't refresh the old one. I kept getting the old swf after i overwrite it. even deleting  the run then upload file still fails.

Also I needed to set visible properties to true i initially if they can e turned off. This doesn't happen on loacal machine.

That is 3 quirks with flash and it has taken many hours working it out. I am tired from having to debug this which shouldn't really happen. It seems to work as what my local copy does. This is a little too much I think. Flash/php integration maybe a little too messy to do anything more than just  basic stuff.
Link to comment
https://forums.phpfreaks.com/topic/36056-combo-quirk/#findComment-171601
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.