Please i want to prevent inserting same "title" to the table.. My code are below
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Download File | JayaSriLanka</title>
<?php
include("../head.php");
?></head><body><?php include("config.php");
mysql_connect("localhost", "jayasri6_dlc", "jaya") or die(mysql_error());echo "Connected to MySQL<br />";mysql_select_db("jayasri6_dlc") or die(mysql_error());echo "Connected to Database"; mysql_query("INSERT INTO example(url,title,size,date,artist) VALUES('$url','$title', '$size', '$date','$artist')") or die(mysql_error()); echo "data inserted";
?>
<div style="text-align:center"><br /><a href="new.php">Back</a><input type="text" size="10" value="/dl/?file=<?php echo $_GET['title']; ?>"/><hr />
<br /><br /><?php
include("../footer.php");
?>
</div></body></html>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Download File | JayaSriLanka</title>
<?php
include("../head.php");
?></head><body><?php include("config.php");
mysql_connect("localhost", "jayasri6_dlc", "jaya") or die(mysql_error());echo "Connected to MySQL<br />";mysql_select_db("jayasri6_dlc") or die(mysql_error());echo "Connected to Database"; mysql_query("INSERT INTO example(url,title,size,date,artist) VALUES('$url','$title', '$size', '$date','$artist')") or die(mysql_error()); echo "data inserted";
?>
<div style="text-align:center"><br /><a href="new.php">Back</a><input type="text" size="10" value="/dl/?file=<?php echo $_GET['title']; ?>"/><hr />
<br /><br /><?php
include("../footer.php");
?>
</div></body></html>
Comment