Jump to content

Recommended Posts

I'm trying to retrieve an image from my database, the code i have works for anything with out a space but once there is a space in a title it only sends the first word.

 

I have tried str_replace, and addslashes to no avail.

 

request for image.

getImage.php?title='" . $title . "'>

 

getImage.php

$title = $_REQUEST['title'];
mysql_select_db("movies");
$results = mysql_query("SELECT * FROM currentlist WHERE title = '" . $title . "'");
while ($row = mysql_fetch_array($results)){
echo $row['coverFront'];
}

Link to comment
https://forums.phpfreaks.com/topic/73890-solved-white-space-problem/
Share on other sites

thats sending it now but still unable to load image thought it was because of the + that were now added but adding urldecode still didn't show the image.

 

even threw decode into a new variable same result.

 

$newTitle = urldecode($title);
$results = mysql_query("SELECT * FROM currentlist WHERE title = '" . $newTitle . "'");

i'm not actually getting an error, just a broken image link, but when i type the information in the browser window i'm able to see that it is in fact grabbing an image from the database and that it is in fact searching the right title.

 

which makes me think that this problem is not related to the original problem.

 

 

edit:

getImage.php?title='" . $title . "'>

 

problematic little single quotes.

changed to

getImage.php?title=" . $title . ">

 

works just fine

 

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.