Hi Iam beginger to PHP and tying to search the follwoing table in the database to select product by typing the product ID or Desc here is the table
CREATE TABLE descriptions (
siteid char(2) NOT NULL default '',
productID int(11) NOT NULL default '0',
brand varchar(255) default NULL,
title varchar(255) default NULL,
desc text,
ingredients text,
longdesc text,
price float(6,2) default NULL,
PRIMARY KEY (siteid,productID)
) TYPE=MyISAM;
and i am using the following code to pull the information from db but it does not work is there anyone who could help me please!!!!!!!!!!!!!!!!!!
</tr>
<?php
require_once('includes/connection.php');
mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASSWORD) or die (mysql_error());
mysql_select_db(DB_NAME) or die (mysql_error());
$desc = ($_POST['desc']);
$search =($_POST['search']);
//SEARCH CUSTOMERS.
$q = mysql_query ("SELECT * ")
. " MATCH ( search, desc )"
. " AGAINST ('{$_POST['search']}' ) "
. " FROM customers"
. " WHERE MATCH ( productID, desc)"
. " AGAINST ( '{$_POST['search']}' )"or die (mysql_error());
$r = mysql_fetch_array($q);
while($r = mysql_fetch_array($q))
{
echo"<td>".$r['productID']."</td>";
echo"<td>".$r['brand']."</td>";
echo"<td>".$r['title']."</td>";
echo"<td>".$r['desc']."</td>";
echo"<td>".$r['ingredients']."</td>";
echo"<td>".$r['longdesc']."</td>";
echo"<td>".$r['price']."</td>";
"</tr>";
}
?>