how to insert multiple php array values into mysql for the same table? -


hi new php , having 3 php arrays namely bookname, bookprice , bookisbn, need insert values like

"bookisbn" "bookname" "bookprice" mysql

eg:

isbn1 bookname1 bookprice1  isbn2  bookname2 bookprice2 isbn3  bookname3 bookprice3 

as of tried iterate 3 arrays like,

foreach($booknamearray $bookname && $bookpricearray $bookprice && $bookisbnarray $bookisbn) { .. } 

and

while($booknamearray $bookname && $bookpricearray $bookprice && $bookisbnarray $bookisbn){ .. } 

nothing worked me, please kindly me out achieve this.

thanks in advance, naveen.

assuming have same number of elements, can use loop, , make string of values:

for($i = 0; $i < count($booknamearray); $i++) {     $str = $booknamearray[$i] . " " . $bookpricearray[$i] . " " . $bookisbnarray[$i];     //insert $str db } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -