Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con=mysqli_connect("localhost","nextseal_new","plokij0987","nextseal_new");
- if (mysqli_connect_errno()){
- echo "connecting failed".mysql_connect_error();
- }
- ?>
- <html>
- <body><center>
- <form method="post">
- <input type="submit" name="show" value="show members">
- </form>
- <form method="post">
- Type only first name:<input type="text" name="del">
- <input type="submit" name="delete" value="delete members">
- </form>
- <form method="post">
- <input type="text" name="namemain"><br>
- <input type="text" name="fname"><br>
- <input type="text" name="lname"><br>
- <input type="text" name="addr"><br>
- <input type="text" name="phone"><br>
- <input type="submit" name="editm" value="add memeber">
- </form>
- <?
- if (isset($_POST['editm']))
- {
- $sql="INSERT INTO persons(name, Firstname, Lastname, address, phone) VALUES('$_POST[namemain]','$_POST[fname]','$_POST[lname]','$_POST[addr]','$_POST[phone]')";
- if (mysqli_query($con,$sql))
- {
- echo "Values Addess Successfully !";
- }
- else {
- echo "Value Couldn't add".mysql_error();
- }
- mysqli_close($con);
- }
- ?>
- <?php
- if (isset($_POST['show']))
- {
- $show="SELECT *FROM persons";
- $result=mysqli_query($con,$show);
- echo "<table border=1>";
- echo "<tr>";
- echo "<td>name</td><td>Firstname</td><td>Lastname</td><td>address</td><td>phone</td>";
- echo "</tr>";
- while ($row=mysqli_fetch_array($result))
- {
- echo "<tr>";
- echo "<td>".$row[0]."</td>";
- echo "<td>".$row[1]."</td>";
- echo "<td>".$row[2]."</td>";
- echo "<td>".$row[3]."</td>";
- echo "<td>".$row[4]."</td>";
- echo "</tr>";
- }
- echo "</table>";
- mysqli_close($con);
- }
- ?>
- <?php
- if (isset($_POST['del']))
- {
- $loilam=$_POST['del'];
- $del="DELETE FROM persons WHERE Firstname='$_POST[del]'";
- mysqli_query($con,$del);
- echo "member delete !";
- }
- ?>
- </cente
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement