by holy24 » Thu Nov 15, 2012 7:08 pm
Hi,
I have been reading the guides on trigger but really no idea what does it means. Is there any other way to create log file as I am quite new to programming? Thanks.
I have already created a web application. So when user login to the web, they can create a record and upon submitting, the user data will be capture into a log file as mentioned below:
1. Which record the user INSERT or UPDATE
2. Their username
3. The date and time that the user INSERT or UPDATE
4. What type of operation (eg. INSERT or UPDATE)
Create.php
<form name="form1" method="post" action="create2.php">
<table border="1" >
<tr>
<td><b>Name:</b></td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td><b>Department:</b></td>
<td><td><input type="text" name="department"></td>
</tr>
</table>
Create2.php
<?php
include 'connectdb.php';
$name=$_POST['name'];
$department=$_POST['department'];
mysql_query ("INSERT INTO table_name (name, department) VALUES ('$name', '$department')");
?>