1) Script Title:

2) Script URL (on DD): http://www.dynamicdrive.com/forums/n...=newthread&f=2

3) Describe problem: engin problem

hello everyone i have this problem with my search engin i wrote the script but it run without any results i don't know what's wrong with it i'll be thankfull if you can help me

the script search in six columns (cars,motors,boats, ....) i but it in combobox

this is the code
<?php
if(isset($_POST['submit']))
{
// database connection info
$conn = mysql_connect('localhost','twoworl1_root','1234567') or trigger_error("SQL", E_USER_ERROR);
$db = mysql_select_db('test',$conn) or trigger_error("SQL", E_USER_ERROR);

$keyword=$_POST['Editbox1'];
$choice = $_POST['Combobox1'];

if($choice=="1") //////////////////////////choice 1////////////////////////////
{
// find out how many rows are in the table
$sql = "SELECT COUNT(*) FROM car where Car_name OR Car_type LIKE '%'.'$keyword'.'%' ORDER BY Car_id DESC ";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
mysql_query("set character_set_server='utf8'");
mysql_query("set names 'utf8'");
$r = mysql_fetch_row($result);
$numrows = $r[0];

// number of rows to show per page
$rowsperpage = 16;
// find out total pages
$totalpages = ceil($numrows / $rowsperpage);

// get the current page or set a default
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
// cast var as int
$currentpage = (int) $_GET['currentpage'];
} else {
// default page num
$currentpage = 1;
} // end if

// if current page is greater than total pages...
if ($currentpage > $totalpages) {
// set current page to last page
$currentpage = $totalpages;
} // end if
// if current page is less than first page...
if ($currentpage < 1) {
// set current page to first page
$currentpage = 1;
} // end if

// the offset of the list, based on current page
$offset = ($currentpage - 1) * $rowsperpage;

// get the info from the db
/*$sql = "SELECT Car_pic FROM car LIMIT $offset, $rowsperpage";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
*/
// while there are rows to be fetched...
/*****************************************************/

$column=4;
echo "<table>\n";

$q=mysql_query ("select * from car where Car_name OR Car_type LIKE '%'.'$keyword'.'%' ORDER BY Car_id DESC LIMIT $offset, $rowsperpage ") or trigger_error(mysql_error(),E_USER_ERROR);
echo "<ul>";
for($i=0;$x=mysql_fetch_array($q);$i++)
{

if(($i%$column)==0)
{
echo "<tr>\n";
}
echo("<td><a href = cars_details.php?man=$x[Car_id]&mad=$x[Car_made]&nam=$x[Car_name]&typ=$x[Car_type]&colr=$x[Car_color]&img=$x[Car_pic]&pri=$x[Car_price]&phon=$x[Car_phone]&disc=$x[Car_disc]&yar=$x[car_year]&emal=$x[email]&cntry=$x[country]&cty=$x[city]&start=$x[dsart]&end=$x[dend]><img src=$x[thumb] HEIGHT='70' WIDTH='120'></a></td>\n");

if(($i%$column)==($column-1)){
echo "</tr>\n";
}
}

}


elseif($choice=="2") ////////////////////////////choice 2 /////////////////////////
{
// find out how many rows are in the table
$sql = "SELECT COUNT(*) FROM motor where Motor_name OR Motor_type LIKE '%'.'$keyword'.'%' ORDER BY Motor_id DESC ";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
mysql_query("set character_set_server='utf8'");
mysql_query("set names 'utf8'");
$r = mysql_fetch_row($result);
$numrows = $r[0];

// number of rows to show per page
$rowsperpage = 16;
// find out total pages
$totalpages = ceil($numrows / $rowsperpage);

// get the current page or set a default
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
// cast var as int
$currentpage = (int) $_GET['currentpage'];
} else {
// default page num
$currentpage = 1;
} // end if

// if current page is greater than total pages...
if ($currentpage > $totalpages) {
// set current page to last page
$currentpage = $totalpages;
} // end if
// if current page is less than first page...
if ($currentpage < 1) {
// set current page to first page
$currentpage = 1;
} // end if

// the offset of the list, based on current page
$offset = ($currentpage - 1) * $rowsperpage;

// get the info from the db
/*$sql = "SELECT Car_pic FROM car LIMIT $offset, $rowsperpage";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
*/
// while there are rows to be fetched...
/*****************************************************/

$column=4;
echo "<table>\n";

$q=mysql_query ("select * from motor where Motor_name OR Motor_type LIKE '%'.'$keyword'.'%' ORDER BY Car_id DESC LIMIT $offset, $rowsperpage ") or trigger_error(mysql_error(),E_USER_ERROR);

for($i=0;$x=mysql_fetch_array($q);$i++)
{

if(($i%$column)==0)
{
echo "<tr>\n";
}
echo("<td><a href = cars_details.php?mad=$x[Car_made]&nam=$x[Car_name]&typ=$x[Car_type]&colr=$x[Car_color]&img=$x[Car_pic]&pri=$x[Car_price]&phon=$x[Car_phone]&disc=$x[Car_disc]&yar=$x[car_year]&emal=$x[email]&cntry=$x[country]&cty=$x[city]&start=$x[dsart]&end=$x[dend]><img src=$x[thumb] HEIGHT='70' WIDTH='120'></a></td>\n");

if(($i%$column)==($column-1)){
echo "</tr>\n";
}
}


}



thank u