Jump to content

How can i do this?


calle08

Recommended Posts

You would use OR in order to get both matching rows -

 

WHERE date ='2011-07-14' OR date='2011-07-20'

 

You want to match rows where date is '2011-07-14' or where date is '2011-07-20'

 

You can also use IN() -

 

WHERE date  IN('2011-07-14','2011-07-20')

Link to comment
https://forums.phpfreaks.com/topic/241892-how-can-i-do-this/#findComment-1242235
Share on other sites

Perhaps if you describe exactly what you are trying to accomplish, someone can help? The query you posted to get help with and the image you posted don't suggest at all what you are trying to do, having something or nothing to do with matching dates in the data. Without a clearly defined statement of what you are trying to accomplish, it's difficult for you to accomplish anything and impossible for us to help.

Link to comment
https://forums.phpfreaks.com/topic/241892-how-can-i-do-this/#findComment-1242294
Share on other sites

I need the result to list one row/name there is one field for every date in the database for user test1 there is two fields but i want to make it to one field and have both dates and comments in that one field. Get it to look like this

 

test1 test1 2011-07-14 yes 2011-07-20 No

test2 test2 2011-07-14 yes 2011-07-20 No

 

I think i need it to be like thig for using while($kolumn = mysql_fetch_array($result)){ to make tables that works. It is hard for me to explain to :)

 

 

SELECT name, date, commentFROM narvaro_allWHERE date BETWEEN '2011-07-14' AND '2011-07-20'

 

If i use that question i get two fields/name i need one.

Link to comment
https://forums.phpfreaks.com/topic/241892-how-can-i-do-this/#findComment-1242321
Share on other sites

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.