Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Posts posted by ginerjm

  1. Jacques1 - Well said!

     

    LovePHP - If you want to help someone in the future, and want to post code, how about posting YOUR code, code that YOU know and can support and not some random script you found. The OP could have easily done that so why do you think that you needed to do that very same thing? We're here to help people with their code and not to be research automatons.

     

    Your brief response in #13

     

    Hehe why

    shows that you aren't up to this task. We take this seriously. If you wish to remain on this site and wish to be of help, responses such as #13 will not do much to improve your reputation.
  2. You check all the lines? What does that mean? In order to know if something doesn't work you actually have to execute it.

     

    As for your html, where did you learn this? You have a label tag linked to a field that doesn't exist. What's the point?

     

    Your style on the first input element - why is the width set to 100%? You want that field to fill the page width?

     

    I'm not aware of your previous postings, but just looking at this one makes me wonder what your background is.

  3. Still would opinions why storing data this way will cause issues other than lack of referential integrity and inability to properly query on a column.

    I think your question/statement answers itself. One of your points refers to proper storage of data in general and the other goes right to the heart of the matter when discussing data storage - How to Get It Back.

  4. I may get my head bit off here, but here goes.

     

    Data is data.

     

    RDBMS is a tool/environment for data.

     

    JSON is a tool for passing data - not for safekeeping.

     

    My point is - Don't store your data in a db in json format. Store it like you would any data and then when you need to encode it for a purpose, do so with the appropriate function.

  5. And maybe you could do what Good Programmers do and add some COMMENTS to the code so we can follow it. And perhaps you could restructure it so that the php is segregated from the html to make it easier to decipher and follow and maintain. And since the only query execution statement is commented out, maybe you could show us how you are retrieving this data? And when you have solved this problem maybe you could make the transition to a new db interface such as mysqlI or PDO since you are only doctoring up outdated code that is soon going to break and not be useable.

     

    So much work to do.

  6. #1 - please post code in the proper code tags

    #2 - Don't understand much about your question other than "it shows all jobs"

    #3 - Why do you think we need to see ALL THIS CODE? Can't you pinpoint where you think your problem is?

    #4 - If I took a guess I would have to say that you need to filter what your query is calling for. Change your where clause to only select what you want to display.

  7. I'm sure it would be do-able. A Json array in the js that you manipulate and then pass back to the server with the Done button where it gets analyzed. Haven't done it myself but it's doable.

     

    An ajax routine might be easier. The arrow click calls a js function that obtains the selected list item (value/text?) and makes the call to the server with that item's info and the direction to move it (up/down,+/-). The server makes the change in the db and passes back the complete new list which the js code then replaces on the web page. That would be simplest IF you know how to setup the ajax call.

  8. First you have to decide if you want to have an interaction with the server when you click the arrows. Is the change in the sequence meant to be temporary, ie, just visual, and not permanent as in having to do a db update to alter the sequence for future builds?

     

    Just visual would be handled by JS code without the server interface. The latter option would either require a call to the server to effect the db update and the re-sending of the page to see the change. Or an ajax call, but that's a whole nother subject.

  9. There are two other main interfaces that are part of PHP. The mysqlI one and PDO. Many people prefer PDO which has a small learning curve but is easy once you've used it a couple fo times, IMHO.

     

    As told, the MySQL interface is so old that PHP has stopped supporting it since php 7. Use it at your own risk because once your host moves to that level your code will no longer work.

  10. You need to look at your code. You move the fetched array into another array. And Repeat.

     

    Why?

     

    If you want to output the results, then output them instead of just copying them to the same array over and over and over again...

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