Jump to content

Query Value and display on HTML code mixing php


nightkarnation

Recommended Posts

Ok here's the complete code of a doubt i have...which because it wasnt complete got mixed, complicated & derivated to another problem on another post,

 

Here everything is working perfect...

But i want to add one more thing to the code (thing that i cant seem to do by myself)

 

the same way that ALLsPromo.gif is being displayed...

I want to display a .jpg but with the name of the location ... that is being query

 

<?php
//Now we search for our search term, in the field the user specified 
$data = mysql_query("SELECT name, email, location, allspromo FROM data WHERE ($field) = '$find' AND (type = '$type' OR type = '$type2')");
//And we display the results 
while($result = mysql_fetch_array( $data )) 
{
//check if promo
if ($result['allspromo'] == "yes") {
?>
<img src="ALLsPromo.gif" alt="All S PROMO SIGN UP!" width="25" height="25" />
//HERE IT WOULD ALSO GO SOMETHING LIKE THIS:
<img src="<?='location'; ?>.jpg" alt="COUNTRY" width="20" height="14" />
//BUT OBVIOUSLY IS NOT WORKING...
<?php
}
echo $result['name']; 
echo "<br>"; 
echo $result['email']; 
echo "<br>"; 
echo $result['location'];
echo "<br>"; 
echo "<br>";


}

 

Any ideas??

Thanx for the help!

Thanx for the reply btherl !

 

Its still not working  :'(

 

What else could it be ?

 

This might help...when the webpage is displayed...the shape and size of the .jpg appears...though the image is missing...if i click to see its properties...this is the path that is giving me:

http://localhost/Test/HtmlPhpMysql/%3C? echo $result['location']; ?>.jpg

It should be:

http://localhost/Test/HtmlPhpMysql/Usa.jpg

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.