Re: how save elements of an array in database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you may use simple "foreach" loop for that.

<?php
$arr = array("one", "two", "three");

foreach ($arr as $value) {
    $insertDbSql = "INSERT INFO `myTbl` VALUES('$value')";
}
?>



________________________________
From: melissa_brown35 <melissa_brown35@xxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Tue, November 2, 2010 2:52:03 PM
Subject:  how save elements of an array in database

  
how save elements of an array in database when we do not know that how many 
elements are in array Like elements might be 5 or 10.


 

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux