nightkarnation Posted September 10, 2008 Share Posted September 10, 2008 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 https://forums.phpfreaks.com/topic/123550-query-value-and-display-on-html-code-mixing-php/ Share on other sites More sharing options...
btherl Posted September 10, 2008 Share Posted September 10, 2008 Try like this: <img src="<? echo $result['location']; ?>.jpg" alt="COUNTRY" width="20" height="14" /> Link to comment https://forums.phpfreaks.com/topic/123550-query-value-and-display-on-html-code-mixing-php/#findComment-638089 Share on other sites More sharing options...
nightkarnation Posted September 10, 2008 Author Share Posted September 10, 2008 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 https://forums.phpfreaks.com/topic/123550-query-value-and-display-on-html-code-mixing-php/#findComment-638095 Share on other sites More sharing options...
nightkarnation Posted September 10, 2008 Author Share Posted September 10, 2008 Ok i got it !!! CORRECT CODE: <img src="<?php echo $result['location']; ?>.jpg" alt="COUNTRY" width="20" height="14" /> yep...<?php WAS CHANGING THE WORLD !! Thanx again! Link to comment https://forums.phpfreaks.com/topic/123550-query-value-and-display-on-html-code-mixing-php/#findComment-638098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.