0
How to hide the command prompt when called in php?
I wrote a php script which is triggered by clicking a button to perform MySQL dump of the database. it works fine but the problem is, the command prompt black window shows up n this makes some users uncomfortable thinking that it's a virus or they are being hacked. Is there any php function that I can use to hide the black window of the command prompt from showing up, but still performing the database dump.
5 odpowiedzi
+ 1
Why use cmd ?? PHP alone can easily connect and read MySQL data and it's pretty neat too.
here: https://www.w3schools.com/php/php_mysql_connect.asp
+ 1
I see your point. but PHP is a script language ... being slow is in it's nature!
I think this is the Best way to do this:
A) Create an array of tables from the database that you want.
B) Use for to loop over and dump them individually.
this way you have more control over your code if you want to make special conditions or say skip one particular table.
0
I use CMD to dump the database. is there another way I can use to get the database dump. without the cmd
0
MySQL itself has a couple commands:
>>> SELECT * INTO OUTFILE `filename` FROM `tablename`;
dumps table inside file.
>>> LOAD DATA INFILE `filename` INTO TABLE `tablename`;
fills table with the data inside file
0
I tried that approach but it didn't work out for me. cause that approach only dumps one table at a time. the database. my application is running has over 280 tables n with a size of over 50 mbs. This approach seems be a little slow