I have two tables, posts and categories. In posts table there is a field categoryId. I want that only those posts are shown category of which is in enabled state, i.e. for which categories.enabled = true.Continue reading
To know the current MYSQL version:
To format and formulate a float value:
FORMAT(SUM(amount) * 0.6, 2)
The above line sums up entire amount value, cut it down to 60% of total value and returns value precised up to 2 decimal places.
To get the size of database in MB
SELECT table_schema “Data Base Name”, sum( data_length + index_length) / 1024 / 1024
“Data Base Size in MB” FROM information_schema.TABLES GROUP BY table_schema ;
Are you facing file uploading errors or not able to install plugins or upload files through ftp to your EC2 installation of WordPress? Possibly folder permissions?? Read on.Continue reading
Redux is a great tool to manage states. To share state among various components in React is always a challenge. Hence it is very useful and helpful to manage state amongh various components using Redux with React.Continue reading
Here is parent
Passing data from child to parent component will look like
I got this error when I moved a site to new server. It was a simple file_get_contents() call to read an image file. If i copy pasted the url of the same file to open in browser it would open just fine but the script would just die for the error similar to the one below.Continue reading
Following some of the most commonly used linux command which I have to use most of the times while managing hosted sites on my and client’ server. It is just few of them which I usually forget and just wanted to make a list here for my own personal reference.Continue reading
I have a
date field in my mysql database table. I want to replace year 2017 in this field to
2019 Following command would do this.
UPDATE races SET `date` =REPLACE( `date` , ‘2018’, ‘2019’ ) WHERE INSTR( `date` , ‘2018’ ) >0
Just saving it for reference here.