I'm currently running a DNS server with a MySQL Backend, and I'm creating scripts to insert data into the MySQL tables.
My question is: Is it possible to have the script run, then request input in the shell to then be put into the script to then be run in a query against the MySQL Server?
For example I have a query to be ran:
INSERT INTO table (domain, type, ttl) VALUES ('$domain', 'TXT', 120);
I want to change the $domain variable on each run of the script and do not want to keep editing the script file.
Thanks for any responses
php myscript somedomain.comor do you want your script to ask for the domain? If the former is OK, then look into$argv: php.net/manual/en/reserved.variables.argv.php If you want the latter, then I would suggest some console library.