dave204 Posted October 8, 2015 Share Posted October 8, 2015 OK - I've pulled together 2 scripts - and come up with the following, but how do I then add the resulting $row['image']; into the URL I had previously, to use inside an Android app?? Previous URL: http://www.padihamcars.com/file_display.php/?id=1 Quite obviously, id=1 no longer applies. So what do I add to this URL from echo $row['image']; ?? Many thanks in advance!! <?php include "file_constants.php"; $link = mysql_connect("$host", "$user", "$pass") or die("Could not connect: " . mysql_error());$sql = "SELECT image FROM test_image ORDER BY id DESC LIMIT 1"; $result = mysql_query("$sql"); $row = mysql_fetch_assoc($result); mysql_close($link); header("Content-type: image/jpeg"); echo $row['image'];?> Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/ Share on other sites More sharing options...
benanamen Posted October 8, 2015 Share Posted October 8, 2015 echo "<img src=\"<?= {$row['image']} ?>\">"; Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522709 Share on other sites More sharing options...
dave204 Posted October 8, 2015 Author Share Posted October 8, 2015 Is it not http://www.padihamca...splay.php/image ?? I need it in the above format, to use inside the Android app.. Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522714 Share on other sites More sharing options...
mac_gyver Posted October 8, 2015 Share Posted October 8, 2015 you need to stop creating new threads for this and read what has already been posted. you were told in the first thread that the code that dynamically outputs the imaged based on the id in the link, isn't the code you need to change. you need to change the code that's producing the links so that it produces a link that contains the highest id. Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522715 Share on other sites More sharing options...
benanamen Posted October 8, 2015 Share Posted October 8, 2015 @mac_gyver, to the second part, the query he now has already gives him the the highest single id. He just needs to output the result. SELECT image FROM test_image ORDER BY id DESC LIMIT 1 Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522718 Share on other sites More sharing options...
benanamen Posted October 8, 2015 Share Posted October 8, 2015 (edited) Is it not http://www.padihamca...splay.php/image ?? I need it in the above format, to use inside the Android app.. No. Attach a zip of ALL your files and an sql dump of your DB so we can handle this once and for all. It doesnt matter about Android. AND STOP MAKING NEW THREADS Edited October 8, 2015 by benanamen Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522719 Share on other sites More sharing options...
dave204 Posted October 8, 2015 Author Share Posted October 8, 2015 Looking like I'll have to work this one out myself, because no one on here can give me the correct php code to produce a link to the http inside the Android app. echo row['image'] just won't cut it inside an Android app.. Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522723 Share on other sites More sharing options...
benanamen Posted October 8, 2015 Share Posted October 8, 2015 Since you are not providing what I asked for, you are now on your own as far as I go. You come here asking for FREE help and wont provide what is asked of you. Quote Link to comment https://forums.phpfreaks.com/topic/298489-how-do-i-add-image-to-url/#findComment-1522724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.