PHP, SQL Server and Triggers

wxdqz

New Member
I have two tables for a forum in the table thread I insert all data like date, subject and that stuff and In the second table I insert the threadid and the text from the thread I use this method because it is faster for making serach.
I use this code to insert the data in the database.

mssql_query("insert into thread values ('', '".$nombre."', '".$respuesta."', '".$email."', 1, 0, '".$fechahora."', '".$grup."', '".$remail."')");
$s=mysql_query("select MAX(threadid) from thread");
list($ai)=mysql_fetch_array($s);
mysql_query("insert into textothread values (".$ai.", '".$texto."')" );

but what I want to do instead of using this PHP code I want to create a trigger in MS Sql Server that atomatically inserts the text and the threadid.
 
Back
Top