PHP Classes
elePHPant
Icontem

There is `mysql` command at the CLI-level.

Recommend this page to a friend!

      PHP MySQL Shell  >  All threads  >  There is `mysql` command at the...  >  (Un) Subscribe thread alerts  
Subject:There is `mysql` command at the...
Summary:Package rating comment
Messages:4
Author:Alexander Ivanou
Date:2019-07-26 15:24:35
 

 

Alexander Ivanou rated this package as follows:

Utility: Bad
Consistency: Not sure
Examples: Sufficient

  1. There is `mysql` command at the...   Reply   Report abuse  
Alexander Ivanou - 2019-07-26 15:24:35
There is `mysql` command at the CLI-level.
`mysql -e 'SQL-statement'` will do the same job.

  2. Re: There is `mysql` command at the...   Reply   Report abuse  
Dev Sharma - 2019-07-26 15:47:37 - In reply to message 1 from Alexander Ivanou
I agree, but do you think many people actually know that a specific MySQL command line at a CLI-Level exists? Do you think they are that technical unless they do some research?


And for a fact, this website is about phpclasses and in no way relates to system administration. Please correct your facts before suggesting something.

This script is absolutely the best for people who want to use command line in PHP.

  3. Re: There is `mysql` command at the...   Reply   Report abuse  
Timo Henke - 2019-08-15 07:23:11 - In reply to message 2 from Dev Sharma
who - if not an admin - will use your script OR mysql commandline from shell to manually do mysql stuff inside the console?

Non technical users will ofcourse fallback to a phpMyAdmin instance to have a gui.

So your class is just a wrapper for

mysql -u'username' -p'password' -h localhost dbname

right?

  4. Re: There is `mysql` command at the...   Reply   Report abuse  
Alexander Ivanou - 2019-08-16 09:54:04 - In reply to message 2 from Dev Sharma
You offer the following solution to php developpers without knowledge of system administration:
1. Run your shell (assuming files have already been downloaded to the current folder)
2. Type SQL query by keyboard or Ctrl-V
3. View result in print_r formatting or see error message
4. Finish or goto 1st step.

The standard way to do such job is:
1. Run standard mysql shell by typing 'mysql' in command prompt
2. Type or Paste SQL statement
3. View SQL results in table mode or error message with numbered code and syntax helper
4. Repeat step 2-3 as nesessary or close mysql shell with command

Of course, your code shows that you know how to format algorithms in a class structure. But I would like to believe that this site is not a platform for demonstrating skills, but is a catalog of codes that deserve attention and place in real projects.