Saturday, January 23, 2016

Bangla PHP OOP and MySQLi CRUD Tutorial (Part-03)

Related Code (create.php):-
include 'inc/header.php'; 
include "config.php";
include "Database.php";

 $db = new Database();
 $name  = mysqli_real_escape_string($db->link, $_POST['name']);
 $email = mysqli_real_escape_string($db->link, $_POST['email']);
 $skill = mysqli_real_escape_string($db->link, $_POST['skill']);
 if($name == '' || $email == '' || $skill == ''){
  $error = "Field must not be Empty !!";
 } else {
  $query = "INSERT INTO tbl_user(name, email, skill) 
   Values('$name', '$email', '$skill')";
  $create = $db->insert($query);

 echo "<span style='color:red'>".$error."</span>";
<form action="create.php" method="post">
  <td><input type="text" name="name" placeholder="Please enter 
  <td><input type="text" name="email" placeholder="Please enter 

  <td><input type="text" name="skill" placeholder="Please enter 
  <input type="submit" name="submit" value="Submit"/>
  <input type="reset" Value="Cancel" />

<a href="index.php">Go Back</a>
<?php include 'inc/footer.php'; ?>

How to practice tutorials…

  • Make a team with your friends (Member should be 4/5).
  • Start to practice one tutorial series along with them.
  • Don’t try to collect source code. Type the code while watching the tutorial.
  • If you face any problem, post the question in the Forum with the error codes.
  • Share that question Link with your friends or team members to solve quickly.
  • Discuss the problem in the Forum along with others - Video Guidelines.