Need to Delete CSV File in PHPMyAdmin - php

I uploaded a .csv file to the backend of my ecommerce website. There are 30,000 products in the file, but I forgot to include the price column. I need to find this file in phpmyadmin if possible and delete it so I can upload a new one with the pricing column on it.
If I have to run a query, I will, but can someone inform me on the most efficient way to tackle this problem?
Thanks in advance.

It might depend on what e-commerce solution your using but have you tried re-uploading the file with the included prices? Typically, this will overwrite/update what you already have in the database.
Also, if you did upload a csv through an e-commerce system, it is probably stored in a writable folder on your server which you could probably get to via FTP. However, if this csv was used to update your DB, deleting it will not have any effect on the DB itself.
This is why re-uploading the updated file will probably update your product prices on your DB as you need it to.

Related

How to duplicate and rename a file when folder content changes - Linux or php script?

I'm exporting .csv file when a new order is made on my site running under prestashop. The site is hosted in a Plesk VM and I need to duplicate the .csv file of the order and rename it to .txt when the .csv is exported. I need to do this operation to connect the .csv with an ERP software.
I don't know how to exactly solve this. My options are:
Create a php script (but I need to store somewhere the folder changes history in order to compare)
Create a linux script (no idea how to do)
Create a cron task.

Back Up My SQL database in PHP

Hello everyone I am pretty new to php. I am trying to create a back up of my sql database and I want the back up to run on php server at the click of a button. I found some templates the issues I am having and it may be due to the wrong templates are: On most of the templates I don't where I should enter the information that is needed to make it work, for ex( host, dbname) etc another issue is I don't know if that's the only part of the code that needs to be changed. If someone could help me find a backup template and tell me step by step how to get my database to export as a file I would greatly appreciate it!sq
Use exec function to call mysqldump, a backup utility program that's bundled with every MySQL database. Pass the folder you would like the file (it will be a .sql file) to be put, and you can simply download or ftp it from there.
A simpler option is to install PHPMyAdmin and you can use it to backup any database and table.
Hope this helps.

If I delete a mySQL database on phpmyadmin will it affect the content uploaded on my ftp server?

If I delete a mySQL database on phpmyadmin will it affect the content uploaded on my ftp server? Are mySQL tables and FTP content related somehow? I am using wordpress to set up the website.
No, they are not related.
Deleting a MySQL database will not impact FTP.
No. The deletion will not affect the files on your server.
Databases have no direct relationship to your FTP files so deleting the database will not delete the FTP content. There is a possibility that your website is using the data in your database to reference the FTP content though. I don't know what you website does but if you give the ability to upload files these may be stored in your FTP directory with a file listing from the database. Therefore deleting the database may break your website and you would no longer have the data that is stored in your database regarding your FTP files. Let me know if you have any questions regarding this.

Retrieve a deleted database in PHPMyAdmin

I accidently deleted the whole database when I should just delete one table in PHPMyAdmin. Is there a way of retrieving the database?
There are two ways:
Have a working backup of the system, and restore the files from it.
An undelete tool might help, if you deleted the db very recently (and ideally, if you unplugged the computer right afterward).
As for doing it with MySQL, though...on all systems i'm aware of, no. MySQL tables are files in the server's data directory, and dropping a table deletes those files. Once they're gone, they're gone, and only the methods above can get them back. A database is a directory of those files, and dropping it deletes the whole directory.
Same thing here :-(
I closed xampp (V3.2.1) found the xampp\mysql\ folder, right-clicked and selected Restore previous version, select recent restore. When this finished I opened xampp and the missing database was back with the information dated as per the restore date. Not ideal but better than no database :-)
Same thing happened with me, found a easy solution. First make a command line access to the database using the mysql.exe file present in xampp/php/bin folder. Delete the phpmyadmin database. Then, just import the create_tables.sql file to the phpmyadmin database. This solved my problem.
Let me know if you face any problem using this.
thanks.
You can retrieve a accidentally deleted database via a file restoration software. Check this free software
http://www.majorgeeks.com/Restoration_d4474.html
More information here -
http://emaillenin.blogspot.com/2010/11/recover-accidentally-deleted-mysql.html

file manager with role based permission

I m a beginner to PHP and MySQL, I am having 3 user roles in my project:
manager
editor
mtuser
Managers account can upload files to the system.
Editors and mtusers are able to download file uploaded by a manager, they can modify those and reupload back to managers (feedback).
I am using a temp directory to store those files on the server.
I want to check with that file like suppose editor and mt user should not uploaded rather then downloaded files how I check that?
I also want to avoid collisions where several users try and write to the same file at once.
I think you want to make use of WebDAV, which is easy to do with PHP. This will allow other users to lock files for editing, so that you avoid collisions.
Regarding the rest, getting permissions is just a simple query away. I'm assuming that you have a table named 'permissions' or something that says what a user can and can not do. What I do recommend is not caching them (i.e. in a session), make sure they are easy to revoke.

Categories