Database Connection Config File in PHP Get link Facebook X Pinterest Email Other Apps June 28, 2024 <?php$conn = new mysqli("localhost","root","","crud");if($conn->connect_error) { die("Connection Failed : " . $conn->connect_error);}?> Get link Facebook X Pinterest Email Other Apps Comments
Update Record File in PHP June 28, 2024 <?php include 'header.php' ; ? > < div id = "main-content" > < h2 > Edit Record </ h2 > < form class = "post-form" action = " <?php $_SERVER [ 'PHP_SELF' ]; ? > " method = "post" > < div class = "form-group" > < label > Id </ label > < input type = "text" name = "sid" /> </ div > < input class = "submit" type = "submit" name = "showbtn" value = "Show" /> </ form > <?php if ( isset ( $_POST [ "showbtn" ])) { include "config.php" ; $stu_id = $_POST [ "sid" ]; $sql = " SELECT * FROM student WHERE sid = { $stu_id } " ; $result = $conn... Read more
Index File in PHP June 28, 2024 <?php include 'header.php' ; ? > < div id = "main-content" > < h2 > All Records </ h2 > <?php include "config.php" ; $sql = " SELECT * FROM student JOIN studentclass WHERE student.sclass = studentclass.cid " ; $result = $conn -> query ( $sql ); if ( $result -> num_rows > 0 ) { ? > < table cellpadding = "7px" > < thead > < th > Id </ th > < th > Name </ th > < th > Address </ th > < th > Class </ th > < th > Phone </ th ... Read more
Edit OR Update Data File in PHP June 28, 2024 <?php include 'header.php' ; ? > < div id = "main-content" > < h2 > Update Record </ h2 > <?php include "config.php" ; $stu_id = $_GET [ "id" ]; $sql = " SELECT * FROM student WHERE sid = { $stu_id } " ; $result = $conn -> query ( $sql ); if ( $result -> num_rows > 0 ) { while ( $row = $result -> fetch_assoc ()) { ? > < form class = "post-form" action = "updatedata.php" method = "post" > < div class = "form-group" > < label > Name </ label > < input type = "hidden" name = "sid" value = " <?php echo $row [ "sid" ]... Read more
Comments
Post a Comment