Replace line break with
This code is used to replace line break saved in database to
in html display
$astring = str_replace(chr(13) . chr(10), "", $astring);
This code is used to replace line break saved in database to
in html display
$astring = str_replace(chr(13) . chr(10), "", $astring);
I faced problem uploading a huge sql file to my shared hosting server. The size was not that big. It was only 1.8MB in size with about 30,000 records but phpMyAdmin (provided in cpanel) still failed to fully upload and run the file.
I then googled for a solution.
One of the solutions suggest to use SSH but I’m not familiar with it.
Another solution is by using mysqldumper but the configuration seems quite tedious.
Then I found another solution called BigDump which is very straight forward. You upload a PHP script together with your huge sql file via FTP. Then just run the PHP script as usual. In a second all the data has been restored in your database.
You will need this SQL statement to list all duplicate contents in a table
SELECT email, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
Sometimes when you are going to execute an SQL statement to your production database, you need to be very careful especially when you are using DELETE or UPDATE command.
To ensure your original data will be available, you can backup the whole table that you are going to do the operation.
To backup the whole table is very easy in phpMyAdmin (even in other SQL tool).
After you done with the operation and it is successful, you can easily drop the temporary backup table.