programming languages - How to make simple sql modifications from shell? -
i have never made software linux, better me now. write simple sql modification
software can run via terminal
, don't need run php, apache. (withouth apache
)
could convert me this:
<?php $le = mysql_query('select * tbl_table alfa="0"'); while ($i = mysql_fetch_assoc($le)) { $le2 = mysql_num_rows('select * tbl_table3 t1id="'.$i["id"].'"'); if ($le2 > 0) { mysql_query('update tbl_table set num="'.$le2.'" id="'.$i["id"].'"'); } } ?>
or can give me tutorial
how write shell command, or can started terminal? or english name of i'm looking for? (linux debian)
there many ways skin cat, i'd go python script.
since you're running linux you'll have python on system. you'll need install mysql driver such mysqldb , convert simple php script python.
there's excellent answer covers you'll need know (and more) here: how connect mysql database in python?.
Comments
Post a Comment