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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.