PHP Classes

prevent duplicate records

Recommend this page to a friend!

      phpMyDataGrid - AJAX Enabled Datagrid  >  All threads  >  prevent duplicate records  >  (Un) Subscribe thread alerts  
Subject:prevent duplicate records
Summary:prevent duplicate records
Messages:1
Author:shazi
Date:2009-07-11 16:04:10
 

  1. prevent duplicate records   Reply   Report abuse  
Picture of shazi shazi - 2009-07-11 16:04:10
<?php
$q = $_GET['q'];
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("database", $con);

$result = mysql_query("SELECT * FROM tbtest
WHERE text_cat='" . $q . "' LIMIT '4' '1'");

while($row = mysql_fetch_array($result))
{
echo $row['user_name'] . "<br>" . $row['text_data'];
echo "<br /><hr>";
}

?>


how can i prevent the duplicate records in this script ...
or any one have another idea toprevent duplicate records