Two Dimm. Arrays

From: Date: Thu, 06 Nov 2003 02:35:18 +0000
Subject: Two Dimm. Arrays
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-22010@lists.php.net to get a copy of this message
How I can populate and restore the two dimensional array dynamically i.e under for/while loop. This is used in pear db but not directly link to just pear. Below is the code in which array is build manually. array( array(1, 'one', 'en'), array(2, 'two', 'to'), array(3, 'three', 'tre'), array(4, 'four', 'fire')); Thank you, Imran > From: "Muhammad Imran" <imran@sdpi.org> > To: <php-windows@lists.php.net> > Sent: Wednesday, November 05, 2003 1:24 PM > Subject: [PHP-WIN] Pear ::DB > > > I am using Pear::DB package, Can anybody help me if I have array of values > and I want to prepare the insert statements through those arrays. > > Below is the example which I find on every site but not found what I need, > please help me. > > Thank you, > Imran > > $alldata = array( array(1, 'one', 'en'), > array(2, 'two', 'to'), > array(3, 'three', 'tre'), > array(4, 'four', 'fire')); > $sth = $dbh->prepare("INSERT INTO numbers VALUES(?,?,?)"); > > $dbh->executeMultiple($sth, $alldata); > } > > >

« previous php.windows (#22010) next »