OK I am going to manually enter in the info I need to the mysql. I have a form that lets me enter in multiple rows worth of data. My problem is my process.php file is not working.
Any idea why? it is suppose to insert muliple rows into my mysql
thanks for help
insert multiple rows
<?php
// Define Variables
$title[0] = $_POST['title1']; // Change the 'title1' to the id of the input box
$title[1] = $_POST['title2'];
$title[2] = $_POST['title3'];
$title[3] = $_POST['title4'];
$title[4] = $_POST['title5'];
$artist[0] = $_POST['artist1'];
$artist[1] = $_POST['artist2'];
$artist[2] = $_POST['artist3'];
$artist[3] = $_POST['artist4'];
$artist[4] = $_POST['artist5'];
$cd[0] = $_POST['cd1'];
$cd[1] = $_POST['cd2'];
$cd[2] = $_POST['cd3'];
$cd[3] = $_POST['cd4'];
$cd[4] = $_POST['cd5'];
$track[0] = $_POST['track1'];
$track[1] = $_POST['track2'];
$track[2] = $_POST['track3'];
$track[3] = $_POST['track4'];
$track[4] = $_POST['track5'];
$length[0] = $_POST['length1'];
$length[1] = $_POST['length2'];
$length[2] = $_POST['length3'];
$length[3] = $_POST['length4'];
$length[4] = $_POST['length5'];
$limit_num = 5; // Number of times the loop will run, make sure the array has 5 values as well or else you will insert blank
rows
$host = "localhost";
$user = "*****";
$password = "*****";
$database = "*****";
// Connect to Database
$connection = mysql_connect($host,$user,$password); // Connect
$select_db = mysql_select_db($database,$connection); // Select DB
for ($z=0; $z<$limit_num; $z++) {
$current_qual = "$title[$z],$artist[$z],$cd[$z],$track[$z],$length[$z]"; // Sets value to the current qual
$query = "INSERT INTO music VALUES ('$current_qual')"; // Query
$result = mysql_query($result,$connection); // Execute
}
?>