Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

Insert Into Database Using PHP MySqli using the following procedures. You must first make sure that you have these steps set up before you proceed.

Prepared Statements

$stmt = $con-gt;prepare("INSERT INTO table (`row1`, `row2`, `row3`) VALUES (?, ?, ?)");
$stmt-gt;bind_param("sss", $var1, $var2, $var3);

$var1 = "your_value_for_var1";
$var2 = "your_value_for_var2";
$var3 = "your_value_for_var3";

$stmt-gt;execute();
$stmt-gt;close();
mysqli_query($con,"INSERT INTO table(`row1`, `row2`, `row3`)
VALUES ('$var1','$var2','$var3')");
Or you can do it like this.
$sql = "INSERT INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', '[email protected]')";

if ($conn-gt;query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "
" . $conn-gt;error; }
Prepared Statement Insert
$stmt = $conn-gt;prepare("INSERT INTO equipment(`user`, `type`, `name`, `price`,) VALUES (?, ?, ?, ?)");
$stmt-gt;bind_param("issd", $uid, $type, $name, $price);
$stmt-gt;execute();
$stmt-gt;close();
i=integer s = string d = decimal

Insert Into Database Using PHP MySqli

IN the code above you will have to make sure that you change row1, row2, and row3 to match whatever you called your table rows when you created them. Make sure you change the "table" as well so that it matches your database. Last make sure that you change the variables that are going to be inserted into your database. If you need help on PHP Variables please see thepost.