Severity: Notice Message: Undefined property: CI::$db in codeigniter 3.16 Are you facing any notice saying Undefined property: Home::$db or something like this in your Codeigniter …
Read MoreDatabase
Altering column size in SQL Server
Altering column size in SQL Server ALTER TABLE table_name ALTER COLUMN column_name datatype; LIKE:: ALTER TABLE `product` MODIFY COLUMN `updatedon` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP …
Read Moremysql – Split value from one field to two
How to split a single column values to multiple column values? For Example: #Current table Field is like:: Name ———— abcd efgh ijk lmn opq …
Read MoreFatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in php7
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in php7 # codeIgniter use mysql_real_escape_string() instead.database connection issue Answer: Use $this->db->escape_str($name); OR $new_name = …
Read Moreupdate all row in codeigniter
update all row in codeigniter $this->db->update_batch() Generates an update string based on the data you supply, and runs the query. You can either pass …
Read MoreCodeigniter – How to Join City Country State by concatenate two fields in Sql
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 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 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 MoreAccess database config variables from a helper in Codeigniter
By using Like this way you can access Codeigniter Files From Helper. $CI =& get_instance(); $CI->load->database();
Read MorePhp – How to Connect Database from Constant file in Codeigniter version 3.0
Here, Using this way you can connect with database from constant file. then you can access the tables. include(APPPATH.’config/database’.EXT); $conn = mysql_connect($db[‘default’][‘hostname’], $db[‘default’][‘username’], $db[‘default’][‘password’]); …
Read More