Forum Moderators: coopster
At the moment I have this:
=================================================
@$this_strQuery = "INSERT INTO `students`(`student_firstname`,`student_lastname`,`phone`,`mobile`,`email`)VALUES(\"$FirstName\",\"$LastName\",\"$Phone\",\"$Mobile\",\"$email\")";
@$this_host = "localhost";
@$this_user = "username";
@$this_pw = "password";
@$this_db = "dbname";
$this_link = mysql_connect($this_host, $this_user, $this_pw);
if (!$this_link) {
die('Could not connect: ' . mysql_error());
}
$this_db_selected = mysql_select_db($this_db, $this_link);
if (!$this_db_selected) {
die ('Can not use $this_db : ' . mysql_error());
}
//insert new record
$this_result = mysql_query($this_strQuery);
if (!$this_result) {
die('Invalid query: ' . mysql_error());
}
mysql_close($this_link);
=====================================================
But say I want to insert form data also into a table called 'qualifications' - now would I go about that?
//insert new record
$this_result = mysql_query($this_strQuery);
if (!$this_result) {
die('Invalid query: ' . mysql_error());
}
// insert record in qualifications table:
$next_query = 'INSERT INTO qualifications ...';
mysql_query($next_query);
mysql_close($this_link);