Hello support,
I am tiring to insert the username into two other tables in my database on a successful registration using the global events feature in PHP Runner, I did the following and I tried the word 'TEST' added fine in the two tables. When I replace 'TEST' with '$strUsername' ( I think $strUsername might be the variable for username) without quotes I get the error "Fatal error: Column count doesn't match value count at row 1 in /var/www/html/aresbeta/regestered/include/dbconnection.php on line 26"
Is there a better way to do this?
The following code is what I did to get 'TEST' into the fields 'Call' in both tables 'equipment' & 'training' without any errors.
function AfterSuccessfulRegistration()
{
//** Insert a record into another table ****
global $conn;
$strSQLInsert1 = "insert into training (Call) values ('TEST')";
$strSQLInsert2 = "insert into equipment (Call) values ('TEST')";
db_exec($strSQLInsert1,$conn);
db_exec($strSQLInsert2,$conn);
}
The following code returns the error on line 26 noted above...
function AfterSuccessfulRegistration()
{
//** Insert a record into another table ****
global $conn;
$strSQLInsert1 = "insert into training (Call) values ($strUsername)";
$strSQLInsert2 = "insert into equipment (Call) values ($strUsername)";
db_exec($strSQLInsert1,$conn);
db_exec($strSQLInsert2,$conn);
}
Thank you