Monday 26 May 2014

Php Wordpress create table if not exists

We can create table for mysql through query for php and wordpress

as

just for simple php we can write code to create the table in mysql as

       $sql = "CREATE TABLE IF NOT EXISTS `social` (
       `id` int(11) unsigned NOT NULL auto_increment,
       `userid` int(11) NOT NULL default '0',
       `type` varchar(500) NOT NULL default '',
       PRIMARY KEY  (`id`)
       ) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    
mysql_query($sql);



through this lines of code we can create the DATABASE table


and for wordpress we will add the two line more as 

       $sql = "CREATE TABLE IF NOT EXISTS `social` (
       `id` int(11) unsigned NOT NULL auto_increment,
       `userid` int(11) NOT NULL default '0',
       `type` varchar(500) NOT NULL default '',
       PRIMARY KEY  (`id`)
       ) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    
         require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );                        
        dbDelta( $sql);


Tuesday 20 May 2014

Html css Psecudo Class

:first-child Selector

We can use the style for first of every div paragraph or anything else.

For it we can use the selector :first-child

like for paragraphs <p>

and we want to make the first paragraph with red color 

we can make it as in css

p:first-child{ color: red; }

this property will make the first line of every paragraph will show in red color 


Here is the example .





<!DOCTYPE html>
<html>
<head>
<style>
p:first-child
{
background-color:red;
}
</style>
</head>
<body>

<p>This paragraph is the first child of its parent (body).</p>

<h1>Welcome world</h1>
<p>This paragraph is not the first child of its parent.</p>

<div>
<p>This paragraph is the first child of its parent (div).</p>
<p>This paragraph is not the first child of its parent.</p>
</div>


</body>
</html>

After running the code you will see that the first paragraph and and first paragraph of every div is red 

Prime Minister Loan Update

It is hereby that Prime minister loans are in next step.

Now the banks are given order to give loan to them who's names were in first lucky draw.

Now the second lucky draw will held on 31 of May.

Lets see who will be the lucky in coming lucky draw on 31May  .