RE: [PHP-WIN] Question

From: Date: Thu, 30 Nov 2000 14:30:14 +0000
Subject: RE: [PHP-WIN] Question
Groups: php.windows 
Request: Send a blank email to php-windows+get-4190@lists.php.net to get a copy of this message
i think like this.. <?php function getLangue($db,$lang,$form) { $get = "select * from langue_tab where nom_form ='".$form."'"; $result = mssql_query($get,$db); $myrow = mssql_fetch_array($result); // you may end of resultset.. while ($myrow = mssql_fetch_array($result)); // *** { $a = $myrow["nom_champs"]; $tableau[$a] = $myrow["champs_fr"]; } return $tableau; } and this is very dangerius.. because your $tableau may exceed memory limit for arrays. how much records you have in db? -----Original Message----- From: Francois Allard [mailto:francoisa@visic.com] Sent: Thursday, November 30, 2000 3:44 PM To: PHP-NEWSGROUP Subject: [PHP-WIN] Question I'm having problem using function... Can someone can tell me what I'm doing wrong Thanks <?php function getLangue($db,$lang,$form) { $get = "select * from langue_tab where nom_form ='".$form."'"; $result = mssql_query($get,$db); $myrow = mssql_fetch_array($result); do { $a = $myrow["nom_champs"]; $tableau[$a] = $myrow["champs_fr"]; } while ($myrow = mssql_fetch_array($result)); return $tableau; } ?> After I try getiing the $tableau informations and it don't work. <?php $langue = getlangue($db,"fr","getcust"); printf($langue["nom"]); ?> Thanks again François -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#4190) next »