Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 09-07-2007, 08:27 AM blank search results
Junior Talker

Posts: 4
Trades: 0
Hi,
I have this php search script, but when I run it I just get this
Quote:
country:
type:
Abstract:
This is the right layout but it is not filling it with results.
The php code is
PHP Code:
<?php 
// Connects to your Database 
mysql_connect("localhost""adder""clifford") or die(mysql_error()) ; 
mysql_select_db("real") or die(mysql_error()) ;
$country = isset($_POST['menuFilesDMA']) ? preg_replace('/[^a-zA-Z0-9\ ]/'''$_POST['menuFilesDMA']) : ''
$type = isset($_POST['Type']) ? preg_replace('/[^a-zA-Z0-9\ ]/'''$_POST['Type']) : ''
$Abstract = isset($_POST['keyword']) ? preg_replace('/[^a-zA-Z0-9\ ]/'''$_POST['keyword']) : ''
if (
$country) { 
     
$where[] = "country='$country'"

if (
$type) { 
     
$where[] = "type='$type'"

if (
$Abstract ) { 
     
$where[] = "Abstract LIKE '%$Abstract%'"

if (
$where) { 
     
$sql "SELECT * FROM items WHERE " implode(' AND '$where); 
     
// query and display results 

 

//Outputs the image and other data
Echo "<b>country:</b> ".$info['country'] . "<br> "
Echo 
"<b>type:</b> ".$info['type'] . " <br>"
Echo 
"<b>Abstract:</b> ".$info['Abstract'] . " <hr>"

?>
Any help would be much appriciated,
Thanks,
Colin
cs1h is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-07-2007, 08:56 PM Re: blank search results
Experienced Talker

Posts: 44
Name: Kuldeep Sahi
Trades: 0
I could not locate the following code where you run the query and fetch the results into an array:

$result=mysql_query($sql) or die(mysql_error().$sql);
$info=mysql_fetch_array($result);

I presume you have already done a echo $sql to check if it is as expected.
__________________

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Kuldeep2195 is offline
Reply With Quote
View Public Profile Visit Kuldeep2195's homepage!
 
Reply     « Reply to blank search results
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20540 seconds with 12 queries