how to use mssql_* function in php on windows platform
February 9, 2008
The following steps enabled MSSQL 2005 support on Windows XP.
(native drivers, not odbc which works out-of-the-box)
1) Place ntwdblib.dll in C:\Windows\System32
2) Place php_mssql.dll in C:\Windows\System32
3) uncomment php_mssql.dll in php.ini
4) Changed my default SQLSERVER 2005 install so it accepts named piped.
(Do this via start-> SQLServer2005->configuration tools->SQL SERVER surface area configuration.
5) reboot.
note*
tested on:
Microsoft SQL Server 2005 and Windows XP With PHP 5.2.3.
Microsoft SQL Server 2000 should work too.
you can download ntwdblib.dll here .
after download please RENAME that file from ntwdblib.dll.jpg to ntwdblib.dll .
I have to rename that file in order to upload it to this wordpress ^_^
Microsoft do offer a SQL Server 2005 driver for PHP at http://www.microsoft.com/sql/technologies/php/default.mspx
It can be download free of charge. Binaries are provided for Windows platform only.
—
postgresql: select all table from database;
February 2, 2008
this sql will return all tables name in your database;
select usename, relname, relkind, relhasrules, from pg_class, pg_user where usesysid=relowner and
(relkind =’r’ or relkind=’i’ or relkind=’s’) and relname !~’^pg_’ and
(relkind !=’i’ or relname !~’^xinx’) order by relname;
this sql has been tested on windows xp pro with postgresql 8 on it.
i use this sql when i was trying to develop ad-hoc report system.
How to make KDE menu look cuter
December 31, 2007
Well, sometimes it is irritating to look at kde menu when it is so bulk and not cute at all.
This is how we can make it more cuter….
1. edit $HOME/.kde/share/config/kickerrc using your own favorite editor. I use kate.
2. to remove kde picture. edit UseSidePixmap to false in [KMenu].
3. icon size. edit MenuEntryHeight = 22 or 16 in [menus].
then run your konsole and type this dcop kicker kicker restart.
and everything should work.
Tested on Slackware 12.0… myslack…
Slackware Screen Shot
December 31, 2007
simple php script to remove newline in text file
November 15, 2007
This is a simple php script ( as reference) created by me to remove newline @ carriage return in my text file and replace it with pipe “|” .
<?php
/* @author : hafeez */
$baca= fopen(“contoh.txt”,“r”);
$tulis = fopen(“output.txt”,“w+”);
$text = fread($read, filesize(“contoh.txt”));
$text = str_replace(“\r\n”,“|”,$text);
echo $text;
fwrite($tulis,$text);
fclose($baca);
fclose($tulis);
?>
contoh.txt :
this is line one
ini line kedua
three
output.txt:
this is line one|ini line kedua|three
ok, enjoy ^_^
How to load Web site faster in Mozilla Firefox
November 9, 2007
How to load Web site faster in Mozilla Firefox
Address Bar -> about:config
Filter: -> network.dns.disableIPv6 -> true network.http.pipelining -> true network.http.pipelining.maxrequests -> 8 network.http.proxy.pipelining -> true
- Restart Mozilla Firefox
How to disable beep sound for link find function in Mozilla Firefox
Address Bar -> about:config
Filter: -> accessibility.typeaheadfind.enablesound -> false
- Restart Mozilla Firefox
Source :
ubuntu
– good luck
–by apit
Javascript Collection(s)
November 9, 2007
popupwindow:
left=0,top=0,width=100,height=100,resizable=1,location=0,
menubar=0,scrollbars=1,status=1,toolbar=0
window size ( useful in iframe function):
function alertSize() {var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == ‘number’ ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in ’standards compliant mode’
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
window.alert( ‘Width = ‘ + myWidth );
window.alert( ‘Height = ‘ + myHeight );
}
scroll function :
function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == ‘number’ ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; source : internet}
MySQL Fulltext Search Function
November 6, 2007
MySQL full-text search is built-in funtion in mysql.
here is the sql comparison between normal search and full-text search:
nomal ;
-SELECT * FROM tblApit WHERE myMsg LIKE ‘%$str_search%’;
Full Text;
– ALTER TABLE tblApit ADD FULLTEXT(myMsg);
- SELECT * FROM tblApit WHERE MATCH(myMsg) AGAINST(‘$str_search’);
your may also search in more than one table; example;
– ALTER TABLE tblApit ADD FULLTEXT(myMsg,myDetails);
- SELECT * FROM tblApit WHERE MATCH(myMsg,myDetails)
AGAINST(‘$str_search’);
ok.. good luck
– by apit
MSSQL Paging Using PHP – ref only
November 5, 2007
This code ONLY for my reference..
<?php
echo $countXX = $rowCount['CC']/50;
isset($_GET['x'])?$x=$_GET['x']:$x=50;
if ($x ==50){ $start=1; $page=$x+50; }
else { $start = ($x-50)+1; $page=$x+50;}
$sql =“SELECT * FROM (SELECT TOP 50 * FROM ( SELECT TOP $x * FROM
MY_USER ORDER BY NAMA ASC) AS newtbl ORDER BY NAMA DESC) newtbl2
ORDER BY NAMA”;
?>
p/s : this script only for my own reference. Plz dont post comment on this post.
PHP Load Time
October 31, 2007
The code
<?php
// Insert this block of code at the very top of your page:
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;
// Place this part at the very end of your page
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ("This page took %f seconds to load.", $totaltime);
?>
– powered by php
– source : tenet


