Rebuild edit.php script from scratch !

So far it returns SQL Values!
TODO: Make the proper SQL query