There are times when you want to insert records in multiple tables. At the same time, you also want to ensure consistency. CodeIgniter simplifies MySQL transactions to perform Database operations on either all or none basis.
Tag » Database
Your PHP Installation Appears to be Missing the MySQL Extension
We were facing the error “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”. We’ve fixed it by upgrading WordPress to match it with PHP 7.0 or higher. We didn’t check PHP, MySQL extension installed on the host.
Live Server Transfer of a CI Project from Localhost – The Efficient Way
CodeIgniter offers an easy mechanism to maintain parameters for development and production environments. It simplifies the process of live server transfer of the CI project. In this article, we’re explaining you the efficient way CodeIgniter offers to easier the live server transfer process and making the site production ready with minor changes.
3 Ways – Insert Record in Codeigniter If not exists Else Update
There’re 3 ways to insert record in Codeigniter if it doesn’t exist else update the record if it exists. Here we’re using Active Record as well as Query Binding features in Codeigniter to insert or update a record.
Screen Options Not Working in WordPress Dashboard
Screen Options Not Working / Saving in WordPress Dashboard is a very irritating problem. Once you update / save any screen option and it doesn’t work at all. Or does only once and fails on next page reload.
MySQL update if value is greater than current value
While working with MySQL database there might be situation when you wish to update certain column only if the value being updated is greater than existing value or current value stored in that column. MySQL GREATEST and LEAST functions are quite handy in such situations. Let’s see how can we use first function to update a column if value is greater than current value.
2 ways to truncate foreign key constrained table
In MySQL we create tables and build relationship among them. In the process if we need to truncate foreign key constrained table then we can’t do it simply and MySQL will throw an error even we have already removed table having foreign key constraint:
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint…
MySQL insert row if not exists else update record
Sometimes we create MySQL tables which don’t contain auto increment primary key column instead they may have unique key or combination of unique indexes. In such tables we wish to insert a new row if primary/unique key or keys combination doesn’t exists and update record if exists.
Display Data in Responsive Columns from Database using PHP
As responsive design has come into trends, I decided to write this post to display Data in Responsive Columns from Database using PHP. Like the image below, a product catalog would be good example of this where columns adjust them automatically to maintain responsiveness with different screen sizes.
Auto increment non primary key column in phpMyAdmin
In MySQL we might need to auto increment a non primary key field or column in a database table. This might require particularly in cases where we have already set a combination of columns as primary key. So here are steps with images to let you understand how can we make a column as auto increment non primary key column in phpMyAdmin.