mysql - Inserting php arrays into mysqli database rows? -
In my MySQLi database, I have 2 columns in the table, an 'author' and the other is 'book' There is an array called '$ author' and a '$ book' in which there are unknown numbers.
I'll call column 'books' with values inside' $ books' and 'other column variables' $ author' which will remain constant in all rows.
Please help if you provide it in a procedural way rather than OOP, it will be appreciated and appreciated.
Let's assume that $ author
is a string and $ books
is an array of integers,
$ sql = "books in your table (author, books); foreign currency ($ books $ book_data) {$ sql. =" ($ Book_data , '$ Author'), ";} $ sql = rtrim ($ sql,", ").") "; // execute query
this constant $ author
with each $ books
will be included as a new line.
Comments
Post a Comment