$sql = "SELECT * FROM student";$result=mysqli_query($conn,$sql);if(!$result){ ? ?die('無法讀取數(shù)據(jù):'.mysqli_error($ conn));}echo '<table align="center" border="1">';echo '<caption><h3>班級信息表</h3></caption>';echo '<tr bgcolor="#7fffd4">';echo '<th>學(xué)號</th><th>姓名</th><th>密碼</th><th> ;性別 </th><th>學(xué)院</th><th> echo '</tr>';while($row = mysqli_fetch_array($result)){ ? ?echo '<tr align="center">'; ? ?echo'<td>'.$row['stu_id'].' </td><td>'.$row['username'].' </td><td> '.$row['password'].' </td><td>'.$row['sex'].' </td> ? ?<td>'.$row['academy'].' </td><td>'.$row['major_class'].' </td><td>< button>請假</button> ? ?<button>曠課</button></td><td></td>';}echo '</tr>';echo '< ;/table>';手學(xué)的不精,這個是畢業(yè)設(shè)計就差這個功能了,還有兩天答辯,麻煩哪位大佬在我的代碼基礎(chǔ)上幫寫一下這個功能實現(xiàn)的代碼.萬分感謝!可以有償幫忙!
沒懂你的意思 你這些數(shù)據(jù)不就是從數(shù)據(jù)路里獲取展示出來的嗎 ?為什么要實現(xiàn)點擊按鈕獲取所在行的數(shù)據(jù)到數(shù)據(jù)庫里面嗎?
還是說你想修改數(shù)據(jù)然后更新數(shù)據(jù)嗎 要是這樣的話? 那就用ajax提交? 獲取所在行的id和數(shù)據(jù)? 然后根據(jù)id修改數(shù)據(jù)就行! 不知道我這樣說能不能明白 可以百度看看
?