How to hide the command prompt when called in php? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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.

22nd Jun 2017, 4:48 AM
Chad Tims
Chad Tims - avatar
5 Answers
+ 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
23rd Jun 2017, 4:58 AM
Mat
Mat - avatar
+ 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.
24th Jun 2017, 7:04 PM
Mat
Mat - avatar
0
I use CMD to dump the database. is there another way I can use to get the database dump. without the cmd
23rd Jun 2017, 1:33 PM
Chad Tims
Chad Tims - avatar
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
24th Jun 2017, 2:16 AM
Mat
Mat - avatar
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
24th Jun 2017, 5:18 AM
Chad Tims
Chad Tims - avatar