i used the following code to create a table table is created but warning is shown
No index defined!
i used the following SQL command to create table
CREATE TABLE IF NOT EXISTS `test` (
`path` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
i used the following PHP code to insert multiple image path into database but each path is store in new row how do i store in single row in SQL table
if ($_FILES) {
$upload = new Upload_Rename();
$destination = 'upload';
$paths=$upload->multiple_files($_FILES['myfile'], $destination);
//Fill this with correct information
$mysql_hostname = "";
$mysql_user = "";
$mysql_password = "";
$mysql_database = "";
$tbl_name="";
$pathfield_name='path';
//
$mysql= new mysqli($mysql_hostname,$mysql_user,$mysql_password,$mysql_database);
foreach($paths as $path){
$query='INSERT INTO `'.$tbl_name.'` (id, `'.$pathfield_name.'`) VALUES ("'.$mysql- >escape_string($path).'");';
$mysql->query($query);}
$mysql->close();
}
?>
<form method="post" enctype="multipart/form-data">
<?php for ($i = 0; $i < 10; $i++): ?>
file: <input type="file" name="myfile[]"><br>
<?php endfor; ?>
<input type="submit">
id,path) into a table that has onlypathcolumn - that's what your code says.