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
trouble selecting a picture
Old 09-17-2007, 11:06 AM trouble selecting a picture
Junior Talker

Posts: 4
Trades: 0
Hi,
I have a search script for my databases and I want it to be able to get a certain picture from a folder on the server that is relevent to its country and type. For example if someone selects germany and news it should gather the germanynews.png pic.
This is my script so far,
Code:
<?
 
mysql_connect("localhost","rttrr","cltrtrd"); 
 
mysql_select_db("real") or die("Unable to select database"); 
$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 please try a different <a href=asearch.html>search</a>.";
} else {
while($row = mysql_fetch_array($result)) {
echo "<img src=http://www.myroho.com/searchthumbs/$Country$Type.png> <br>"; // <---I want this line to get the picture--->
echo "<b>Name:</b> ".$row['name'] . "<br> "; 
echo "<b>Email:</b> ".$row['Email'] . " <br>"; 
echo "<b>Country:</b> ".$row['Country'] . "<br> "; 
echo "<b>Type:</b> ".$row['Type'] . " <br>";
echo "<b>Title:</b> ".$row['Title'] . "<br> "; 
echo "<b>Abstract:</b> ".$row['Abstract'] . " <br>"; 
echo "<b>Article:</b> ".$row['Article'] . " <hr>"; 
}
}
?>
If any one can help me work out how to do this it would be much appriciated.
Cheers
Colin
cs1h is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-18-2007, 03:09 PM Re: trouble selecting a picture
Super Talker

Posts: 130
Trades: 0
If I were to have set this up, I might have a country table and in that table also have the image that is associated with that country. I would then simply search for a country and then display the image. Let me know if i've completely misunderstood what you're going for here.
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to trouble selecting a picture
 

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.22681 seconds with 12 queries