Interview Questions
How to remove duplicate entries from a table ?
Removing Duplicate entries from Mysql database table are really simple. I have found some times interviewer ask tricky questions like this. PHP-MYSQL Beginners just be careful !
It can all be done with three manual SQL steps! No PHP Coding required, and it works with MySQL 4 and above versions.
Step One -
CREATE TABLE MyNewTable as SELECT * FROM MyOldTable WHERE 1 GROUP BY [column to remove duplicates by]; |
Step Two – You hate to keep old table with all the duplicate entries, so drop it!
DROP TABLE MyOldTable; |
RENAME TABLE MyNewTable TO MyOldTable; |
What is diffrence between echo and print?
Print method can return a true/false value. This may be helpful during a script execution of somesort. If you need to output data through a function, you can use print()
instead
Echo does not return a value, but has been considered as a faster executed command. echo is not a function and, as such, it does not have a return value.
echo 30;
print (30);
How many types of Tags are available in php?
Standard Tags <?php
… code
?>
Short Tags <?
… code
?>
<?= $variable ?>
Script Tags <script language=“php”>
… code
</script>
ASP Tags <%
… code
%>
Short tags, script tags and ASP tags are all considered deprecated and their use is strongly discouraged.

