how to correctly write drush sql-sycn using drush_invoke_process() I need to execute a drush command from a custom module, Im using drush_invoke_process() but I do not know how to write it correctly

How would you write this command for use with drush_invoke_process() ?

drush sql-sync @site1 @site2 --tables-list table1,table2,tableN


How to write the above command in drush_invoke_process() syntax?

Thanks
From your php code:

$values = drush_invoke_process('@none', 'sql-sync', array('@site1', '@site2'), array('tables-list' =&gt; 'table1,table2,tableN'));


$values will be an array containing various interesting information about the Drush call.  In particular, check $values['error'] to see if the command succeeded or not.