Faqts

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 1 people (0%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

got segmentation fault when echo each element through an array a for loop

Jan 31st, 2010 17:15
forum net tr, i can do it, Andy Fu,


Hi All:
I have an array named $machineNames which already have data in it, now I
 got a segmentation fault from the code below:
(This code works fine with PHP4, but not with PHP5, Thanks a lot for help!)
The problem occured at echo line:
    echo '<div dojoType="TreeNode" title="'.$machineNames[$i].'"
widgetId="'.$machineNames[$i].'"  objectId="root" isFolder="true">';
--------------code----------------------------
<?php
for($i=0; $i< $machineNum; $i++)
  {
    echo '<div dojoType="TreeNode" title="'.$machineNames[$i].'"
widgetId="'.$machineNames[$i].'"  objectId="root" isFolder="true">';
    $sql="select distinct category from aclog where
machine='".$machineNames[$i]."' order by category";
    $result1 = @sybase_query($sql, $connection) or die ("Could not
execute Sybase SQL query.");
    $nums = @sybase_num_rows($result1);
    for($j=0; $j<$nums; $j++)
      {
        $tmpcat =sybase_result($result1, $j, "category");
        echo '<div dojoType="TreeNode" title="'.$tmpcat.'"
widgetId="'.$tmpcat.'___'.$i.'_'.$j.'"  objectId="'.$machineNames[$i].'"
isFolder="false"></div>';
      }
    echo '</div>';
  }?>
derlenmis turk video sitesi http://www.videoturk.gen.tr Video secilmis
youtube videolari http://www.youtubevideolari.net/ youtube videos online
video izle tr tube http://www.videotrtube.com/
firmalar sirketler rehberi http://www.sirketfirmarehberi.com/ firma
sirket rehberi adres telefon bilgileri
full program full oyun http://www.forumnettr.com/ download