Wednesday, August 21, 2013

I want to reset the item order of one of my table after deleting an item in between

// I want to reset the item order of one of my table after deleting an item in between

i got this code from the web, but i have lost the link. i want to say thank you to the original writer, this code works perfect/

mysql_query("SET @ordering_inc = 1;"); 
mysql_query("SET @new_ordering = 0;"); 
mysql_query("UPDATE " . $tbname . "_dt SET seq = (@new_ordering := @new_ordering + @ordering_inc) where billno='$billno' and date='$bdate' and oid='$oid' ORDER BY seq ;"); 


Friday, August 2, 2013

How to Install Advanced find / replace plugin for Gedit in Linux mint 14

My friend told me he can find and replace text in multiple file using NotePlus. so i google and found a few link for this.

The first one i try, but not success.
First Link

So i try the second link , this time it works perfectly.

this is how i did as instructed .

i open a terminal and paste the following command


cd
wget http://advanced-find.googlecode.com/files/advanced_find-0.5.1.tar.gz
tar -xvf advanced_find-0.5.1.tar.gz
cd advanced_find-0.5.1
./install.sh


next it ask me for my password.

then i open gedit and go to Edit/Preference/Plugins and select the Adcance/Replace plugin
that is it. i am done.



Friday, May 31, 2013

How to get the current domain name and path in php


$scriptname=end(explode('/',$_SERVER['PHP_SELF']));
$scriptpath=str_replace($scriptname,'',$_SERVER['PHP_SELF']);
$scriptpath= $_SERVER['SERVER_NAME'] . $scriptpath;

Sunday, April 14, 2013

Php curl not working

Having problem getting to curl_init()

so i started  phpinfo() and checked curl not enabled

i do the following

sudo apt-get install php5-curl

then it says

Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following package was automatically installed and is no longer required:
  gir1.2-gucharmap-2.90
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
  php5-curl

so i do as instrcuted:

sudo apt-get autoremove

but still can get php5-curl installed

so i do

sudo apt-get update

then

sudo apt-get install php5-curl

this time i can see it in phpinfo()

but it is still not working

so i do


sudo /etc/init.d/apache2 restart

this time it work perfectly. yahoo!








Saturday, March 16, 2013

How to set tab to 4 space in vim

at the terminal type

vim ~/.vimrc then press enter

press i to enter insert mode

then key in

set tabstop=4

press [esc] then type :wq to save