This topic is locked

Insert a record into another table

3/12/2009 12:33:13 PM
PHPRunner General questions
H
hernanccs author

Hi guys, im new to this forums and im unable to find information about how to use this function
//** Insert a record into another table ****

global $conn;
$strSQLInsert = "insert into records (Agent, Week) values (Name, WeekYear)";

db_exec($strSQLInsert,$conn);
How do i exactly read the values i just entered in the form? I want to write the value of Name and WeekYear in the table records on the fields Agent and Week
Thanks

J
Jane 3/13/2009

Hi,
entered values are stored in the $values array, I.e.

global $conn;

$strSQLInsert = "insert into records (Agent, Week) values ('".$values["Name"]."','".$values["WeekYear"]."')";

db_exec($strSQLInsert,$conn);