am trying to insert to a database
and am getting the following error
cannot seem to get rid of it and get the info inserted
can anyone see my probs
any help would be appreciated
<?php
$tablename = 'members';
$fields = array("first_name", "surname", "email");
$values = array( "Tam", "Bam","tambam@bools.com");
$database = 'tool';
$host = 'localhost';
$username = 'tool';
$password = 'yippee';
// Connecting, selecting database
mysql_connect($host, $username, $pass)
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db($user) or die('Could not select database');
function add_record($tablename, $fields, $values, $database, $host, $username, $password) {
$record = mysql_queryINSERT INTO members(first_name,surname,email)
VALUES('Tam','Bam','tambam@bools.com')
if (!$record) {
echo "INSERT into contacts table failed: ".mysql_error();
}
}
echo $record;
?>
error reads
Parse error: syntax error, unexpected T_STRING in / / line 25
and am getting the following error
cannot seem to get rid of it and get the info inserted
can anyone see my probs
any help would be appreciated
<?php
$tablename = 'members';
$fields = array("first_name", "surname", "email");
$values = array( "Tam", "Bam","tambam@bools.com");
$database = 'tool';
$host = 'localhost';
$username = 'tool';
$password = 'yippee';
// Connecting, selecting database
mysql_connect($host, $username, $pass)
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db($user) or die('Could not select database');
function add_record($tablename, $fields, $values, $database, $host, $username, $password) {
$record = mysql_queryINSERT INTO members(first_name,surname,email)
VALUES('Tam','Bam','tambam@bools.com')
if (!$record) {
echo "INSERT into contacts table failed: ".mysql_error();
}
}
echo $record;
?>
error reads
Parse error: syntax error, unexpected T_STRING in / / line 25