Sunday, June 21, 2015

How to do FULL JOIN in MYSQL

MYSQL don't support FULL JOIN. But there is a good trick to do this in easy way.
Follow this code and it's simple.

with two tables t1,t2:
SELECT * FROM  t1  LEFT   JOIN  t2  ON  t1.id=t2.id
UNION
SELECT * FROM  t1 RIGHT  JOIN t2  ON  t1.id=t2.id

See very simple to do!!!!!!!!!!!! 

Saturday, June 20, 2015

Prevent to close browser or change page and show message javascript

Add this script before ending body tag.

<script>
window.onbeforeunload = function (evt) {
 var message = 'Do you want to leave this page?';
if (typeof evt == 'undefined') {
 evt = window.event;

}
 if (evt ) {
   evt.returnValue = message;
 }

    return message;

}
 onClick="return confirm('Do you want to leave this page?');"

</script>

Thursday, June 11, 2015

Share WAMP/XAMPP/localhost with other computer via cable (php+mysql server localhost for a team)

Setup web development environment for a team(PHP+MYSQL).

1. Connecting PC through cable (It can be done also via WiFi)
2. Assign IP for each PC.





3. Open httpd.conf file under Apache and configure.Add this code inside </Directory> tag
allow different IP which we've been setup.

        Require all granted
   #   onlineoffline tag - don't remove
Order Deny,Allow
   #   Deny from all
        Allow from 192.168.0.10
Allow from 192.168.0.11 
Allow from ::1
Allow from localhost
</Directory>

4. Go to control panel and select Firewall. Click  "allow a program..." left side menu and allow Apache  HTPP Server for Public.

Done. Now run only one WAMP/XAMP and  use/ browse localhost from other connected PC.
that PC install WAMP/XAMP use it's IP Like
http://192.168.0.10/

Done!!!!!!!!!!!!!!!!!

Total Pageviews