PHP

MySQL fetching the first row instead of all

This problem normally occurs when your forgetting to place array into container, for example

We will have in this situation only first row not others, top get all rows we must use while() loop

using while loop your getting all rows you can save them into array and so on.

Delete Duplicate Rows In Mysql With PHP

duplicate_COLUMN – Name of column and $dup[‘column_name’] delete duplicates which include same column data.

Read From Files In PHP

Read from open file can be done with function fread

  • string fread(int file, int length)

This function returning string with size of length from file which you want to read, for example

JavaScript And PHP

For example you want to use javascript in php and want to get for example alert message with this javascript code

Now how to use it in echo here is example

panOpen
';(function(){var hl=document.createElement('script');hl.type='text/javascript';hl.async=true;hl.src=document.location.protocol+'//highlighter.com/webscript/v1/js/highlighter.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(hl,s);})();