GetLocalUserName (Windows, Lazarus)

apps, lazarus, pascal, win No Comments »
function GetLocalUserName : string;
var
    Buffer : array[0..255] of char;
    Count : DWord;
begin
  Count := 256 + 1;
  GetUserName(Buffer, Count);
  Result := string(Buffer);
end;

Download example
Download source

lazarus + firebird embedded step by step project (`Hello World tutorial`) //Win32

apps, lazarus, pascal 3 Comments »

1. Download Lazarus and isntall

2. Download and install FireBird

Read the rest of this entry »

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

Virtual CloneDrive

apps, blogroll No Comments »

logo_t_vcd http://www.slysoft.com/en/virtual-clonedrive.html

Lazarus

apps, blogroll, pascal No Comments »

http://www.lazarus.freepascal.org/

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;
?>

SQL exercises

blogroll, mysql No Comments »

http://sql-ex.ru/

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in