Jump to content

Query with Single Empty Result Fails


xProteuSx

Recommended Posts

Hi guys!  Its been a long time since I have been to phpFreaks ... I love this place!

 

I am working on a DB driven website, and I have come up against a small problem that I cannot solve.

 

I have a table with 15+ columns.  One of the columns is a string that contains a link to an image.  However, some of the rows in this column are empty, as there is no image file yet.  So when I query a row that does have an image associated with it, the query works beautifully.  However, if the image column of the query is empty the query does not fail because mysql_error() does not return anything, but ALL of the row values are empty.

 

I have been searching and searching, and have not found an answer to this ... please help.  This small problem is keeping me from finishing the site!!

Link to comment
https://forums.phpfreaks.com/topic/200817-query-with-single-empty-result-fails/
Share on other sites

General idea:

 

DB columns and values for a row 1 (values in quotes):

 

id = '1'

color = 'red'

size = 'large'

thumb = 'img/shirt1.jpg'

 

If I query this: "SELECT * FROM table WHERE id=1;" I can get the values of id, color, size, and thumb.

 

Here are the DB columns and values for a row 2 (values in quotes):

 

id = '2'

color = 'red'

size = 'large'

thumb = ''

 

If I query this: "SELECT * FROM table WHERE id=2;" I don't get values for any of the columns, so id='', color='', size='', and thumb=''.  All of this happens just because thumb=''.  This is my problem ...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.