Jump to content

How do I add 'image' to URL?


dave204

Recommended Posts

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'];
?>

Link to comment
Share on other sites

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.

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.