|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
class series { var $ID=0; var $objectArray=array(); //'ID'->position function initFromDB($ID) { if (!$ID) { die("<DIV CLASS='error'>ID is not set in series->initFromDB</DIV>"); } $this->ID=$ID; $query="SELECT objectID,position FROM objectSeriesXRef WHERE seriesID=$ID ORDER BY position"; if (!$result=mysql_query($query)) { die("<DIV CLASS='error'>" . __FILE__ . ": Line " . __LINE__ . "<BR>$query<BR>" . mysql_error() . "</DIV>"); } while ( list($ID,$position)=mysql_fetch_row($result) ) { $this->objectArray[$ID]=$position; } } }; $series=new series; echo "<BR>sID2: $seriesID"; $series->initFromDB($seriesID); echo "<BR>sID3: $seriesID"; /* if $ID in series->initFromDB is NOT modified, no problem occurs */