Hello
I made a simple PHP program to check if the record already exist it will show a message on the same page.
However it does not seems to work even the records already exist.
[php]<?php
if (isset($_POST[‘submit’]))
{
include ‘db.php’;//Connect to database
$title=$_POST[‘title’] ;
$author= $_POST[‘author’] ;
$name=$_POST[‘name’] ;
$copy=$_POST[‘copy’] ;
$title_search = mysqli_query($con,"SELECT * FROM Books WHERE Title='$title'");
if ($title_search == $title)
{
Echo 'Record already exist!';
}
mysql_query("INSERT INTO `books`(
Title,
Author,
PublisherName,
CopyrightYear)
VALUES
(
'$title',
'$author',
'$name',
'$copy'
)");
}
?>[/php]