WinBinder

blogroll, php No Comments »

WinbinderWinBinder is a new open source extension for PHP, the script programming language. It allows PHP programmers to easily build native Windows applications.

MySQL GUI Tools

blogroll, mysql No Comments »
  • MySQL Administrator
  • MySQL Query Browser
  • MySQL Migration Toolkit

http://dev.mysql.com/downloads/gui-tools

  • MySQL Workbench (MySQL Workbench is a next-generation visual database design application that can be used to efficiently design, manage and document database schemata.)

http://dev.mysql.com/downloads/workbench

Get visitors IP

php No Comments »
    $ip = $_SERVER['REMOTE_ADDR'];

mysql_insert_id

blogroll, mysql, php No Comments »
       mysql_insert_id()

http://php.net/manual/en/function.mysql-insert-id.php

mysql_affected_rows

blogroll, mysql, php No Comments »
       mysql_affected_rows()

http://php.net/manual/en/function.mysql-affected-rows.php

simple mysql trigger examples

mysql No Comments »
#drop trigger
DROP TRIGGER `TRIGGER_NAME`
 
#auto DateTime, Date, Time
CREATE TRIGGER `TRIGGER_NAME` BEFORE INSERT ON `TABLE_NAME`
 FOR EACH ROW SET NEW.DATEFIELD = NOW()
 
#insert something in another table
CREATE TRIGGER `TRIGGER_NAME` AFTER INSERT ON `TABLE_NAME`
 FOR EACH ROW
  INSERT INTO another_table SET some_field = NEW.fieldfromparenttable, text_field = 'sometext'
 
#if statement
CREATE TRIGGER `TRIGGER_NAME` AFTER INSERT ON `TABLE_NAME`
 FOR EACH ROW BEGIN
  IF NEW.Type = 0 THEN
    INSERT INTO another_table SET ParentType = NEW.Type;
  END IF;
 END

Handy mysql class

blogroll, mysql No Comments »

ternary operators

php No Comments »
<?
   echo ($a == 0 ? "zero" : "not zero");
?>

http://php.net/ternary

Variable Variables in php

php No Comments »
<?php
 $PK = "PrimaryID";
 $$PK = "100034";
 echo $PrimaryID; // 100034
 echo $$PK;             // 100034
?>

Defining Constants in PHP

php No Comments »
<?
  define("VERSION", 2);
  echo "Current version is " . VERSION;
?>
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in