Skip to content

Tag: mysql

MySQL to fetch all the records based on a month of a year

I have a table and in that table there is a column called date_created, which is in TIME STAMP format 2016-07-20 11:30:15 and while I am fetching record I have to pass only the month and year in my front-end field like (month_no/year) 1/2016, 2/2016, 3/2016….. So I have to fetch all the record based upon a month. So how

MYSQL Add working days to date

I want to add 5 days to the provided date, but the calculation must skip weekends. I already know how to add 5 days without skipping weekends: SELECT DATE_ADD(`date_field`, INTERVAL 5 DAY) As …

What’s the meaning of RESTRICT in Foreign Keys?

There is 4 cases: (For example I’m talking about ON DELETE) CASCADE: the referencing rows will be deleted automatically along with the referenced ones. SET NULL: the value of referencing record will be set to NULL automatically along with the referenced ones. NO ACTION: There will not be any change in the the referencing rows when the referenced ones are

PHP Prepared statement bind_param() error

Many people on stackoverflow has had this problem, but i still cannot spot the mistake This is the error: This is the lines of code: Answer After every mysqli or PDO function that COULD return a bad/failed status you must test for that possibility. The error Fatal error: Call to a member function bind_param() on boolean says it all. $insertpost