save unlimited data to sql database - mysql

I would like to know how its possible to store 1000 or more images and be able to access them when you log in to your account.
I tried doing it with database and link them to your email so that every time you log in your profile will show up. I found it difficult to do. I didn't want to create tables for each image.
What other way is their to store unlimited data without having to create a table? Just link email to be able to access data.

I hope i do not misunderstand your question, but can you not store your 1000 images on your server and save the file direction in a table? Similar to an admin system you could use a php form to upload the images, storing each name into the database, then you can use php and mysqli to retrieve them all into a page or wherever you want them. maybe add keywords to them so you can find them easily with:
<?php
include 'connect.php';
SELECT * FROM table WHERE keywords LIKE $search_key;
?>
Then its just a case of echo.
Hope this helps

It's all about 1 to many , you have to be able create not two but three table, one for user one for unique save and one for haw many save as he wants under the unique save. it's all about planning ahead

Related

Mysql make column in table user specific

I would like to give a little background. I use Kodi which is set up to use my MySQL Server for storing all it needs to remember.
There is one table that stores the physical file location together with a flag whether that file was watched before or not.
I now want to share my DB with my family but I don't want them to have the same "seen" flags as I have. They should be able to store their own values.
I don't want to set up a separate MySQL Server for each of them and I would like to avoid making changes to the Kodi Code.
So is there a way I can make this column like a link that changes depending on the user that has logged in? So that the MySQL Query for Kodi keeps the same but the answer from the Server differs, depending on the user account?
Or are there any other ways you would accomplish this?
Thanks in advance :)

Storing text message in a temp space

Hi I am trying to design a discussion forum where i want to archive the text messages and store it in a folder(or any place using path). Whenever the user again logs in and want to continue i want to extract it and display the previous chat. So question is am i doing correct design in archiving text and retrieving it again ? If yes what is the best format to archive the text (.pdf or .csv or .txt) and store it in a place suggested by path (path info is stored in mysql) or in a folder and folder path in mysql.
The discussion forum looks like twitter. Please throw some light on the design part.
Thanks in advance.
Wouldn't be better to work directly in the database?
That way you can store all information in a organized and indexed way.
All you need is create your tables and columns attempting to the data size. Like VARCHAR(NUM OF BYTES) or TEXT() for a long text.
For any additional content, like attachment or answers, you can use other tables referencing the original table throught Primary Key column.

Mapping users to all of their files(URLs) in a mysql database.

What I want is that when I have looked up a user in a table, I want to list all the file urls that the user have access to. My first thought was to have a field in the table with a list of file URLs. However, I have now understood that there are no such field type.
I was then thinking that maybe ForeignKeys might work, but I am having trouble getting my head around it.
Another solution maybe is to have one table for each user, with each row representing each file.
What would you say is best practice in this case?
I am also going to expand into having shared files, but thought that I'd address this issue first.
Suggest you explore the JSON Data Type
2 tables: user and user_uri_permission? 2 columns in the second: userID and URI. When the User-URI pair is in the table the use has access.

MYSQL - best Data Structure

I’m currently developing an Application for Win, Linux Mac. The Purpose of the Application is that multiple users are able create Projects based on a single Article. Every Article has up to 15 different Fields/Options (could also be more in future). The Fields of the Article should be changeable so I should be able to add, edit or remove them.
Fields I want to store:
Numbers
Texts (mostly options [1 Word], sometimes Comments [some sentences])
Path/Links to Files
What I want to do with the dB:
load all projects of a user at login
add, edit, remove, delete single projects
set a lock on projects (because multiple people are operating one user-account at the same time and therefore they may not be allowed to edit a project at the same time so if one starts editing it should be locked until he's saving, channelling or time-out)
What is the best way to manage this kind of Data?
Should I create a Table for each user and only make a ID Column and one where all the Values of the all the fields (who are merged to one big string)?
Should I create Tables for every Project and make Columns for every Field/Option and also one for the user / owner?
Or are there any other possibility’s?
If you don't know what you are going to store, then I doubt whether a relational database is the best option for you. Maybe a document store/noSQL database is a better decision, because you can just store documents (usually in the form of Json objects) that can have all kinds of additional fields.
A couple of such databases to look at are MongoDB, Cassandra, ElasticSearch, but you can find a big list on Wikipedia.

Neo4J custom load CSV

I asked a question a few days ago to know how to import an existing database into Neo4J. Thanks to the person who explained me how to do that. I decided to create a CSV file from my database (around 1 million entries) and to load it from the Neo4j webadmin to test it. The problem is that each row of this database contains redundant data, for example my database contains actions from different users but each user can do mutliple actions. The structure of my graph would be to create a node for each user that is linked to each action he does. That's why I have to create only one node for each user even if his name appears in several rows of my CSV file (because he made several actions). What is the method to do that ? I guess it's possible to do that in Cypher right ?
Thanks a lot
Regards
Sam
In case you have references that might or might not exist, you should use the MERGE statement. MERGE either finds something or creates something in your database.
Please refer to the respective section in the reference manual: http://docs.neo4j.org/chunked/stable/cypherdoc-importing-csv-files-with-cypher.html. Here the country is shared my multiple users there the country is merged wheres the users and their relationships to countries are unconditionally created.