Jump to content

How can i do this?


calle08

Recommended Posts

Thats the problem i always get the result as the first example in picture ex1. Thats wrong i want it to look like ex2. It is a script that tell if you can come or not. To print it on a web page i need it to look like ex2 is it possible?

 

[attachment deleted by admin]

Link to comment
Share on other sites

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