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.
My situation is that I am creating a wordpress plugin, it creates a table in the directory on activation.
This table holds information entered into the plugin, when information is being entered the user has the option to upload images. The number they will choose to upload I do not know.
The issue I am having is figuring out how to add these URLS into the database, sure I can just put them in there but again I do not know how many URLS need to be added.
As I cannot use normalization with wordpress, how would I store the URLS in the DB. Say they upload 5 images but I do not have 5 separate columns (URL 1, URL 2...)
I should also note that these images will be fetched using a for loop, so each image will be sent off regardless of the number they are uploading.
Any help would be appreciated
Cheers.
Also, You can make additional table with:
id, information_id, filename, ordr
Firstly, insert into infromation_table, get last inserted ID
Then, insert into filenames_table all your filenames in order
Finally, you can select data:
SELECT i.id, i.title, GROUP_CONCAT(a.filename ORDER BY a.ordr ASC SEPARATOR ',') AS filenames
FROM information_table AS i
JOIN filenames_table AS a ON (a.information_id = i.id)
If you want to store all image urls or other data into one DB row, you must create an array with all the information that you need, and then using serialize you can put this array in one filed in the database.
This filed must be TEXT or LONGTEXT to be able to collect all this information.
Then, when you get data back, you must use unserialize and data will be converted to arrays again if needed.
This is how WP stores information in the postmeta table.
Note that in this way you cannot easily query the data, so if this is important to you maybe will be better to store each image on separate row.
Sorry if this is a duplicate question but Im not quote sure what Im looking for when it comes to MYSQL terminology. Im a WP Developer so this is a little new to me.
I have my _postmeta table with a load of different meta fields. One particular is called "Description". I have downloaded the CSV and replaced the data in the Description content. I now have a CSV with three columns (POST ID, Meta Key (all description) & Meta Value). What I want to do is to use PHPMyAdmin to run a query to update all the current meta values with the content I now have in my CSV.
Your help is much appreciated.
Thanks
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.
I've csv file that contains email + street address. I've wordpress installation with users that have same email and I'd like to import street addresses to respective users in user_meta table.
How can I do this?
One stupid way that comes to mind is to use text editor search and replace to create a huge list of insert queries.
Any better way to do this?
You can use
LOAD DATA INFILE your_file.csv
INTO your_table
References: Load data - MySQL