PHP: Connect Mysql Database Using PDO

<!– <?php $user=’root’; $pass=’www.cheapglasses123.com’; $dbh = new PDO(‘mysql:host=localhost;dbname=yzmedu’, $user, $pass); ?> –> <?php try { $dbh = new PDO(‘mysql:host=localhost;dbname=yzmedu’, $user, $pass); // var_dump($dbh); foreach($dbh->query(‘SELECT * from message’) as $row) { echo “<pre>”; print_r($row); echo “</pre>”; } $dbh = null; }… Read morePHP: Connect Mysql Database Using PDO

WordPress SEO

We should take care the following points on wordpress seo: 1. meta title: We shoud let wordpress shows different titles for homepage, page, post, categories, very simple, replace the original title related code to <title><?php wp_title(‘&laquo;’, true, ‘right’); ?> <?php… Read moreWordPress SEO

Remove hyperlinks ( A tag) from HTML

Sometimes we want to remove hyperlinks with anker text, sometimes only keep anker text, how to use php to achive this? First, only remove hyperlink, and keep anker text part, the code is: $text = ‘Test paragraph.’;