Jump to content

Recommended Posts

Hi,

 

I am trying to gather search results from the following script, as far as I can tell it is finding the right amount of results but the results are blank.

 

<?

//connect to your database ** EDIT REQUIRED HERE **
mysql_connect("localhost","adder","clifford"); //(host, username, password)

//specify database ** EDIT REQUIRED HERE **
mysql_select_db("real") or die("Unable to select database"); //select which database we're using

$keywords = preg_split("/[\s,]+/", trim($_POST['keyword']));
$sql = "SELECT * FROM items WHERE country='" . mysql_real_escape_string($_POST['menuFilesDMA']) . "' AND type='" . mysql_real_escape_string($_POST['Type']) . "' AND Abstract LIKE '%$keyword%'";

$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if($num_rows == 0) {
echo "No results<BR>n";
} else {
while($row = mysql_fetch_array($result)) {
echo "<img src=http://www.myroho.com/images/".$info['photo'] ."> <br>"; 
echo "<b>Article:</b> ".$info['Article'] . "<br> "; 
echo "<b>Email:</b> ".$info['Email'] . " <br>"; 
echo "<b>Abstract:</b> ".$info['Abstract'] . " <hr>"; 
}
}
?>

 

If anyone can help me it will be much appriciated.

 

Thanks

Colin

Link to comment
https://forums.phpfreaks.com/topic/68840-solved-blank-search-results/
Share on other sites

replace

while($row = mysql_fetch_array($result)) {
echo "<img src=http://www.myroho.com/images/".$info['photo'] ."> <br>"; 
echo "<b>Article:</b> ".$info['Article'] . "<br> "; 
echo "<b>Email:</b> ".$info['Email'] . " <br>"; 
echo "<b>Abstract:</b> ".$info['Abstract'] . " <hr>"; 
}

 

with

while($row = mysql_fetch_array($result)) {
echo "<img src=http://www.myroho.com/images/".$row['photo'] ."> <br>"; 
echo "<b>Article:</b> ".$row['Article'] . "<br> "; 
echo "<b>Email:</b> ".$row['Email'] . " <br>"; 
echo "<b>Abstract:</b> ".$row['Abstract'] . " <hr>"; 
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.