xProteuSx Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
atul_php Posted May 5, 2010 Share Posted May 5, 2010 Can you post the database schema and query for better understanding... Link to comment https://forums.phpfreaks.com/topic/200817-query-with-single-empty-result-fails/#findComment-1053690 Share on other sites More sharing options...
xProteuSx Posted May 5, 2010 Author Share Posted May 5, 2010 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 ... Link to comment https://forums.phpfreaks.com/topic/200817-query-with-single-empty-result-fails/#findComment-1053714 Share on other sites More sharing options...
xProteuSx Posted May 5, 2010 Author Share Posted May 5, 2010 Sorry, I was making a query to two different tables, and I just realized that the second table did not always have a corresponding data set ... got it all worked out ... Thanks anyways. Link to comment https://forums.phpfreaks.com/topic/200817-query-with-single-empty-result-fails/#findComment-1053723 Share on other sites More sharing options...
phpchamps Posted May 5, 2010 Share Posted May 5, 2010 ahaan........ Gr8:) Link to comment https://forums.phpfreaks.com/topic/200817-query-with-single-empty-result-fails/#findComment-1053726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.