Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Posts posted by ginerjm

  1. Why do you unset those two row elements? They are not a bother to you.

     

    As for the element creation you didn't follow my instructions. You LITERALLY s/b using $ArrayY[], not $ArraY[$two]. Your method is populating the element with index of whatever $two contains, not a new element for each book id.

     

    And what is this use of those meaningless $one,$two,$three vars? What are they? And why is $three an array itself?

  2. What are you beginning with? IE, what is $seconds defined as (int,str,datetime?) and what do you store in it? Since you are using a round function I can only assume that it is an integer. Therefore I would assume that you put some kind of unix time into it to start and therefore any date() function should output what you want or allow you to do math on it.

     

    What have you tried so far?

  3. The code you have posted is so disjoint that it makes it difficult to see what you are doing. I think I know what you want to do, and that itself is very simple, but the code you posted makes it hard to provide answers.

     

    Look at it from our point of view. Would you understand if you didn't already know what you are doing?

     

    1 - build the page for the user using your db data.

    2 - let the user see the page and click on stuff

    3 - handle the submitted page by grabbing the POST elements

    4 - use the grabbed elements to run a query

    5 - use the query results to build the results page.

     

    That's the basic scenario

  4. I'd remove the @ chars. Why would you EVER NOT want to know if those two statements failed for some strange reason?

     

    There is some debate over the worth of the @ usage. I don't believe in it being used ever since hiding errors/notices is simply not the way to be a good programmer. If it's an error, handle it. If it's a notice, well, it is a notice and must be there for a reason so if you are aware of it, program around the reason for it.

    • Like 1
  5. Ok - now you have made yourself clear. If you re-read your OP you will see how it was confusing.

     

    All you really want to do is to click on an item and have that sent to the server for handling. Ok - so you should have this listbox inside a form element and have a submit button for the form that triggers your script. In that script you grab the POST element for your list box (whatever the name= is in the select tag) and validate it to be sure it is correct and then use that value to search your db for whatever info you want to send back to the client in a new output arrangement.

     

    Ok?

  6. Moving on - Trying to figure out what your question is. For what purpose do you want to link your listbox to your database? I'm assuming that you already building the listbox by getting data from the database and looping thru some results to build the option tags. Why do you need a link to the database, or in other words, what are you trying to do once you have it built?

  7. That was not clear in your initial question. Very difficult to understand.

     

    So how are you going to "query" for something that doesn't exist? Using your current query logic I don't see how you will have any of the "missing" records in your result set.

     

    Perhaps you should create your output based upon the given date range by using PHP date functions to generate the necessary "work dates" and THEN populate those rows/dates using any matching query results within the range as I proposed.

     

    Of course there will probably be someone who has a query-based solution, but that's how I would have approached the problem.

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