exec() vs system() vs passthru() exec — Execute an external program passthru — Execute an external program and display raw output
How can I prevent SQL injection in PHP?
How do we check with PHP if directory exists – Both would return true on Unix systems – in Unix is a file, including directories
PROBLEM: When a PHP application makes a database connection it of course generally needs to pass a login and password. If you are using a single, minimum-permission login for my…
SOLUTION :1 We generally use when working with transactions looks like this (semi-pseudo-code): [pastacode lang=”sql” manual=”try%20%7B%0A%20%20%20%20%2F%2F%20First%20of%20all%2C%20let’s%20begin%20a%20transaction%0A%20%20%20%20%24db-%3EbeginTransaction()%3B%0A%0A%20%20%20%20%2F%2F%20A%20set%20of%20queries%3B%20if%20one%20fails%2C%20an%20exception%20should%20be%20thrown%0A%20%20%20%20%24db-%3Equery(‘first%20query’)%3B%0A%20%20%20%20%24db-%3Equery(‘second%20query’)%3B%0A%20%20%20%20%24db-%3Equery(‘third%20query’)%3B%0A%0A%20%20%20%20%2F%2F%20If%20we%20arrive%20here%2C%20it%20means%20that%20no%20exception%20was%20thrown%0A%20%20%20%20%2F%2F%20i.e.%20no%20query%20has%20failed%2C%20and%20we%20can%20commit%20the%20transaction%0A%20%20%20%20%24db-%3Ecommit()%3B%0A%7D%20catch%20(Exception%20%24e)%20%7B%0A%20%20%20%20%2F%2F%20An%20exception%20has%20been%20thrown%0A%20%20%20%20%2F%2F%20We%20must%20rollback%20the%20transaction%0A%20%20%20%20%24db-%3Erollback()%3B%0A%7D%0A” message=”jQuery Code” highlight=”” provider=”manual”/] [ad type=”banner”] Note that, with this idea, if a query…