Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Posts posted by ober

  1. Do not store them in the database.  That's a complete waste of time and DBMS resources.

     

    When you upload them to the server, simply append an ID to the front of the filename: 1234_pic_of_my_dog.jpg

     

    Then you have a table in the database like this:

     

    user_id | media_id

    1          1234

    1          2345

    2          8942

     

    etc.

     

    Then when you need to display them, simply get all the ids for the user out of the table and go retrieve all the files that start with media_id_.

  2. It is because you are using the OR operator. You are basically only asking that one OR the other is filled in. Simply change "||" to "&&" and it will check both.

    Wrong.  He wants to bail if either meets the criteria.  For your scenario, both would have to fail.

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