如何将自动生成的数据存储到数据库中

HTML代码

<table width=50%>
                        <thead>
                            <tr>
                                <th>Student ID</th>
                                <th>Student Name</th>
                                <th>Student Email</th>
                                <th>Modified By</th>
                                <th>Modified On</th>
                                <th>Update</th>
                                <th>Delete</th>
                            </tr>
                        </thead>
                        <tbody >
                            <tr>
                                <td align=center><input type="text" ng-model="addData.student_id"  placeholder="Enter Student ID" ng-required="true"></td>
                                <td align=center><input type="text" ng-model="addData.student_name"  placeholder="Enter Student Name" ng-required="true" ></td>
                                <td align=center><button type="submit"  ng-disabled="testform.$invalid">Add</button></td>
                            </tr>
                            <tr ng-repeat="data in namesData" ng-include="getTemplate(data)"></tr>

                        </tbody>
                    </table>

我想将{{data.student_id}}@gmail.com显示到数据库中。在我的数据库中,此列的数据类型设置为student_gmail

 <script type="text/ng-template" id="display">
                    <td align=center>{{data.student_id}}</td>
                    <td align=center>{{data.student_name}}</td>
                    <td align=center>{{data.student_id}}@gmail.com</td>
                    <td align=center>{{data.admin_name[0]}}</td>
                    <td align=center>{{data.std_mod_date}}</td>
                    <td align=center><button type="button"  ng-click="showUpdate(data)">Update</button></td>
                    <td align=center><button type="button"  ng-click="deleteData(data.student_id)">Delete</button></td>
                </script>

插入查询:

$query = "
 INSERT INTO student 
 (student_id, student_name,  std_mod_date) VALUES 
 (:student_id, :student_name, NOW())
";
评论