Im still uncertain as to what ive doen wrong here- im trying to create a form with an insert statement. My form displays fine but when I test it my database is stil empty! Worst of all even though ive put echo statements in to test it out they don't show up in my localhost.
<?php
$user="root";
$host="localhost"
$password="";
$database="c:\MySQL\data\taf";
case "login":
$connection = mysql_connect($localhost, $root,$password)
or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database.");
if (isset($POST['submit'])) {
$q1 = $POST['q1'];
$q2 = $POST['q2'];
$q3 = $POST['q3'];
$q4 = $POST['q4'];
$q5 = $POST['q5'];
$q6 = $POST['q6'];
$q7 = $POST['q7'];
$q8 = $POST['q8'];
echo 'q2 = ' . $POST['q2'] . '<br />';
$sql = "INSERT INTO journalentry (tresponse)
VALUES ('', '" . $POST['q1'] . "', '" . $POST['q2'] . "', '" . $POST['q3'] . ''', '" . $POST['q4'] . "', '" . $POST['q5'] . "', '" . $POST['q6'] . "','" . $POST['q7']."', '" . $POST['q8'] . "','" );
$result = $db->query($sql); echo $sql;
?>