Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Posts posted by benanamen

  1. Use an ENUM type where you can actually store strings like “waiting” and “delivered”.

     

    Are you really advocating using the actual word value instead of doing as Psycho suggested " I would have a separate table with the status descriptions".

     

    I am sure you must be aware of the numerous issues with using enum.

  2. Yes and yes. I didn't say yours was wrong.  And yes, it is the field name, not the field value which I think is what the OP needs since he uses TD and not TH

     

    I use that very type of code on my table row list pages to create dynamic tables.

     

    Pulled from one of my pages...

    foreach ($result as $row)
        {
        echo " <tr> \n";
        foreach ($row as $name => $value)
            {
            echo " <td>$value</td> \n";
            }
        echo " </tr> \n";  
        }
    
  3. You could just search and replace the ( with a ,( which will give you a comma separated list as long as that format is consistent in your data meaning numbers followed by a left ellipses.

     

    That would give you

    9780735585157,(pbk.;teacher's manual)

     

    Then you could do whatever you want with the properly formatted data.

  4. Example:

    <?php
        $sql  = "SELECT id, name FROM table";
        $stmt = $pdo->prepare($sql);
        $stmt->execute();
        $result = $stmt->fetchAll();
    ?>
    <form action="<?= $_SERVER['SCRIPT_NAME'] ?>" method="post"> 
        <select name="id">
        <?php foreach ($result as $row) :?>
        <option value="<?= $row['id']; ?>"><?= $row['name']; ?></option>
        <?php endforeach; ?>
        </select>
        <button name="submit" class="btn btn-primary">Submit</button>
    
    </form>
    
  5. I have been tasked to create an data entry and storage system

     

    I have no prior PHP knowledge.

    Why in the world are they having someone with no experience build an application?

     

    Our financial provider is not happy with he csv format I am sending the data in to him

     

    That's because they know even less than you do. In that format you can pretty much end up with any output you want.  Since you have no experience, it is probably not something you should be attempting for use in a real business scenario. I could not PM you. I am available for hire.

  6. OP, You were already given numerous replies to this on the other forum. Why are you again posting the same exact question here?

     

    As you said the other day on the other forum

    "Thanks to everybodt for all you help and advise. My web sites work well now.

    I changed everything to <?php"

     

  7. Admittedly, I am far from clear on what he is doing with the limited information he has provided in this thread. Looking at the image in post #22 it just doesn't look right for a DB design.

     

    The comment was in direct response to the 3 tables at the bottom of the image. Admin, Master, and Franchisee which all have a single column with an ID from who knows where or what it is supposed to mean. You're not really saying that is correct are you?

     

    Additionally, the OP's sql dump from post #24 has no keys tying any of the data together and then there is the negative values in table Master_Reqruitment. What in heaven's name does that mean?

     

    I have no idea what information was given in some unlinked thread.

     

    Could you, @Jaques1, build a proper DB application based on this thread?

  8.  

     

    In case the recruits do does not get all their permissions, their ID is not inserted into their individual tables.

     

    Whatever your doing, inserting an id into individual tables is just wrong. You don't seem to grasp how to provide the information needed for someone to help you with this, so I am going back to passing on this. Good luck.

  9. Does each level only recruit the level directly below them or all levels below them?

     

    Example: Can a boss recruit a franch or only a master and admin? 

     

    What happens if a recruit does not get all the confirmations?

     

    This is what I mean by rules and details.

  10. Not upset at all. Lets try this again. Forget that you have any code or database and you were hiring someone to build the application.

     

    Provide a detailed explanation of the project and requirements.

     

     

    All I know so far is it is some sort of "recruiting" app. Recruiting who for what? Who is recruiting who? What rules or restrictions are their on the recruiters and the same for those being recruited and so on. What are ALL the parameters for this app?

  11. I am going to leave this to someone else. Do you really think someone could build a database application from the information you provided in this thread? And I don't think the DB is wrong, It just is.

     

    * A flow chart is not business rules.

    * The picture is NOT a blueprint. It is your incorrect attempt to do whatever it is you're trying to do which you have far from made clear.

    * "simple recruitee - recruit application." Who the heck knows what that involves. You clearly have not said.

    * "The rules are simple as I told you that it's hierarchical in nature." - Completely meaningless. No one could build anything from what you have said and provided.

     

    I have no desire to continually have to drag information out of you.

  12. I did study the picture for a little bit and it is clear you definitely have design issues even without knowing what it does.

     

    From your description it is apparent we need to define exactly what this app is going to do and the rules regarding that before a single table is created. So if you have not done so already, put together a detailed requirement list for this app including a much more detailed description of the app. Think in terms of a blueprint for a house. With a proper blueprint any Builder could build the house without asking questions.

  13. A picture is for hanging on the wall. Please post the actual SQL dump. I have no idea what all the pretty colors mean and cannot see how tables are tied together. I can't import a picture to my database and recreate your schema and I cant run queries against a picture.

     

    It will be helpful to have an overview of what this app is.

  14. It's pretty clear that your database design is completely wrong. Unless you fix it correctly, everything you do with the database will be some sort of hack. You were offered to have experts review your database design at no charge yet you don't take advantage of it. I don't understand that. If you go into coding with a "it works so I'll use it" attitude you're not going to get very far.

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