Codeigniter – How to Join City Country State by concatenate two fields in Sql $this->db->select(” CONCAT(c.name,’-‘,co.code) as id,CONCAT(c.name,’ ,’,s.name,’ ,’,co.name) as text”,FALSE); $this->db->from(“city c”); $this->db->join(‘state …
Read MoreCodeIgniter
How To Remove html tags from validation_errors() in Codeigniter
How To Remove html tags from validation_errors() in Codeigniter Remove html tags from validation_errors() in Codeigniter Set the Opening tag and Closing Tags for error …
Read MoreFinding Duplicates with SQL
#Finding Duplicates with SQL:: SELECT `email`, COUNT(`email`) AS NumOccurrences FROM `user` GROUP BY `email` HAVING ( COUNT(`email`) > 1 ) For Single Occurance Use:: SELECT …
Read MoreHow to prevent duplicate usernames when people register? PHP/MySQL
$connect = mysql_connect(‘whatever’,’whatever’,’whatever’); $database = mysql_select_db(‘your dbname’); $username = $_POST[‘username’]; if(isset($username)){ $mysql_get_users = mysql_query(“SELECT * FROM table_name where username=’$username'”); $get_rows = mysql_affected_rows($connect); if($get_rows >=1){ echo …
Read MorePageSpeed: Leverage browser caching
PageSpeed: Leverage browser caching Find your .htaccess file in the root of your domain. This file is a hidden file but should show up in …
Read MorePhp- Star rating
<?php for ($rcnt=0; $rcnt<$product_rating; $rcnt++) { ?> <i class=”fa fa-star has-star” aria-hidden=”true”></i> <?php } for($star_blank=0; $star_blank < (5-$product_rating); $star_blank++){ ?> <i class=”fa fa-star-o” aria-hidden=”true”></i> <?php …
Read MoreHow can I show dots (“…”) in a span with hidden overflow?
How can I show dots (“…”) in a div with hidden overflow? ._shr_name{ display:inline-block; width:180px; white-space: nowrap; overflow:hidden …
Read MorePHP – Convert stdClass object to array
The easiest way is to JSON-encode your object and then decode it back to an array: $array = json_decode(json_encode($object), True); you can traverse the object …
Read MoreCodeigniter- $this->db->like is case sensitive
There is no case insensitive version of the like function. What you can do is transform both sides of the comparison to lower case, so …
Read MoreThe /e modifier is deprecated, use preg_replace_callback instead
I’m getting notices on server with PHP 5.5 preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead i’m not sure but it seems the entity_decode …
Read More