Created a new website www.mahaphpcode.com for php guys
Making blogs in blogger
Posted September 25, 2009 by pravin2006Categories: Uncategorized
Its very easy to start making your blogs and start earning money through adsense . I have made blog http://forex-my-pravin.blogspot.com today.
I have created new site www.mahacet.com
Posted August 12, 2009 by pravin2006Categories: Uncategorized
Hello ,
I am writing this post after a long . I have created a new site named
www.mahacet.com . This site is a educational website containing details for all cets like CAT , MAT , CET, MCA etc . I am trying hard to promote the site and add google analytics get into it .
Installing phpmyadmin on linux
Posted April 17, 2009 by pravin2006Categories: Uncategorized
I was writing this post after a very long time …. Now here i faced a problem installing phpmyadmin on linux …
Access denied error …..
For those whose geeting while logging through phpmyadmin should include following lines in config.inc.php
$i=0;
$i++;
$cfg['PmaAbsoluteUri']=’localhost/phpmyadmin/’;
$cfg['Servers'][$i]['host'] = ‘Localhost’;
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = ‘true’;
// This will definitely solve the problem ….
install internet explorer in linux
Posted February 18, 2009 by pravin2006Categories: achievements
Following are the steps which will install ie in linux machine.
sudo apt-get install wine cabextract
Now you need to download IEs4Linux script from here
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.0.5.tar.gz
tar xzvf ies4linux-2.0.5.tar.gz
cd ies4linux-2.0.5
Once you are inside ies4linux-2.0.5 directory you need to run the following script to install internet explorer
./ies4linux
You will get ie icon on ur desktop… Restart the computer if needed….
<!– Begin BidVertiser code –>
<SCRIPT LANGUAGE=”JavaScript1.1″ SRC=”http://bdv.bidvertiser.com/BidVertiser.dbm?pid=255410&bid=623554″ type=”text/javascript”></SCRIPT>
<noscript><a href=”http://www.bidvertiser.com/bdv/BidVertiser/bdv_advertiser.dbm”>pay per click advertising</a></noscript>
<!– End BidVertiser code –>
How to get first and last record in mysql
Posted January 6, 2009 by pravin2006Categories: mysql
Hey , its very easy . Its just using two queries and a simple UNION…
for simplication , i m diving the query, the first one is
select A.id from (select id from graph order by id asc limit 1) A // this will give the lowest id , similarly
select B.id from (select id from graph order by id desc limit 1) B // this will give the highest id , similarly
Now , joining the two queries with UNION will serve the purpose
select A.id from (select id from graph order by id asc limit 1) A UNION
select B.id from (select id from graph order by id desc limit 1) B // will give two records
+——+
| id |
+——+
| 1 |
| 1078 |
+——+
Longest query of my life
Posted December 17, 2008 by pravin2006Categories: mysql
mysql -H -u mauj -p mauj -e “select count(*) as DownloadCount,W.phone as PhoneModel,sum(W.un) as NumberOfUser from (select count(*) as un,mo ,phone from wap_tran_1 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_2 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_3 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_4 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_5 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_6 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_7 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_12 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_13 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_14 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_32 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_33 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_57 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_172 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_171 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_173 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_203 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_204 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_205 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_206 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_207 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo UNION select count(*) as un,mo ,phone from wap_tran_208 where servid=1 and type=3 and ts like ‘%2008-01%’ group by phone,mo) as W group by W.phone” > /home/pravin/vodaphone.html
26/11 terror attack
Posted December 9, 2008 by pravin2006Categories: Uncategorized

Glittering and Glowing Taj
array_multisort in php
Posted December 9, 2008 by pravin2006Categories: PHP, perl
Today i have used array_multisort function of php , its very easy …
I got a array, may be assoaciative example $name_array = (
[0] = array
(
[id] => 1,
[name] = > pravin
)
[1] = array
(
[id] => 2,
[name] = > navin
)
// and so on
)
// for sorting is by name alphabetically , we will use array_multisort();
first we will store all the names from the array in another array
$names = array(‘pravin’,'navin’);
// now we will array_multisort to sott by name
$sort_array = array_multisort($names, SORT_ASC , SORT_STRING, $name_array)
// this will change the sequence of array and return navin first with all details then pravin bcoz , ‘n’ comes before ‘p’
// if we want reverse just use SORT_DESC
Thats all … its easy to use …
Important php links
Posted November 26, 2008 by pravin2006Categories: PHP
1) http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/
2) http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/#AboutMySQLandPHP
3) http://www.cs.wcupa.edu/~rkline/perl2php/#stringops