Tag Archives: php tips and tricks

40+ Useful Php tips for beginners – Part 3

By | April 7, 2012

Part 2 26. Avoid direct SQL query , abstract it $query = "INSERT INTO users(name , email , address , phone) VALUES('$name' , '$email' , '$address' , '$phone')"; $db->query($query); //call to mysqli_query() The above is the simplest way way of writing sql queries and interacting with databases for operations like INSERT, UPDATE, DELETE etc. But… Read More »

40+ Useful Php tips for beginners – Part 2

By | April 7, 2012

Part 1 11. Do not gzip output in your application , make apache do that Thinking of using ob_gzhandler ? No dont do that. It doesnt make sense. Php is supposed to write your application. Dont worry about how to optimise data transfer between server and browser inside Php. Use apache mod_gzip/mod_deflate to compress content… Read More »