The difference in months between dates in MySQL

I'm looking to calculate the number of months between 2 date time fields. Is there a better way than getting the unix timestamp and the dividing by 2 592 000 (seconds) and rounding up whithin MySQL?

I am not able to update form data to MySQL using PHP and jQuery

What happens is that I'm able to add and delete records from form using jQuery and PHP scripts to MYSQL database, but I am not able to update data which was retrieved from the database. The file...

CodeIgniter without a Database?

Sorry if this is a simple question, is it possible to load codeigniter without a db setup? I have sess_use_db set to false in the config, I tried renaming database.php to something else but it...

generate_series() equivalent in MySQL

I need to do a query and join with all days of the year but in my db there isn't a calendar table. After google-ing I found generate_series() in PostgreSQL. Does MySQL have anything similar? My...

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO)

I'm using XAMPP on Windows 7. and when I try to open a login.php of current project I get this error Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using...

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

The following code: Class.forName("com.mysql.jdbc.Driver"); Connection m_connection = DriverManager.getConnection("jdbc:mysql://localhost","root","root"); Throws this exception on...

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through...

Mysql adding user for remote access

I created user [email protected]'%' with password 'password. But I can not connect with: mysql_connect('localhost:3306', 'user', 'password'); When I created user [email protected]'localhost', I was able to connect....

Prestashop - How to add a custom input field to product customization and write to db

Having gained no response on the official Prestashop forum, I thought I would try turning to you guys, my first post. Thanks for reading. I am building a site that sells personalized items, and it...

phpMyAdmin cannot connect to MySQL server

I really need help to fix this error, because next Monday is my final year project presentation, please. I don't know how to fix this. I've try to follow this...

SQL 0 if negative value

So I want to turn negative value's into a 0. I found 2 solutions that do exactly the same: SUM(IF(ordered_item.amount < 0, 0, ordered_item.amount)) as purchases And SUM(CASE WHEN...

Use JDBC/Mysql Connector in intellij idea

I'm new in Java, and I need to establish a connection to a MySQL server (local), I have add the libraries in Intellij idea but it seems not work, the IDE can't find the class i think... I become...

Google Cloud SQL increasing size until full disk with no reason

I don't know how to explain this well, but I will try. I use Google Cloud SQL second edition with 20 GB disk size. I have several wp. databases with 166.5 MB Total size. And right now my Storage...

Order by FIELD() using doctrine, is it possible?

I am working on a project which is built using Symfony and Doctrine, however I am still new to the whole setup. Cut a long story short I have need to order a result set by the order of the array...

Print php table to pdf

I have a table generated by PHP and a lot of MySQL query. It looks like this: I need to print this table to a PDF file. I've tried TCPDF and it works great but it doesn't support external CSS....

write a query to this..?

Students and Grades. Students contains three columns ID, Name and Marks, Grades-(grade,min_mark,max_mark) Ketty gives Eve a task to generate a report containing three columns: Name, Grade and...

How to ORDER BY 'name + 0' in codeIgniter (mysql)

I have a table in a MySQL database that looks like this: id | name 1 | 1 some words 2 | 2 some other words 3 | 1.1 some other words ... 10 | 10 some other words If I sort the table using...

Node.js/MySQL: Printing actual query in error log in Node.js

I have some Node.js code that tries to update a database in something like the following: connection.query(command, function(err,rows) { if (err){ ...

Foreach Loop does not insert all records from quickbooks to MySQL database.

I been working on Quickbooks PHP API and I wanted to get data from quickbooks and save in MYSQL using PHP script. I have successfully connected Quickbooks with PHP and I have done queries to get...

An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused

I have a problem with docker and symfony to access mysql. To try to query mysql by connecting to the php container: docker exec -it symfony_php bash Then I execute the following...

WordPress Editor not updating files: Unable to communicate back with site to check for fatal errors

Hello fellow developers and problem-solvers. I've run into an issue with updating the header.php file in a WordPress website. Firstly, I tried updating the file manually through C-Panel -> File...

TypeORM createQueryBuilder can't manage a JOIN

I'm new with TypeORM. I'm working with node, typescript, TypeORM, and MySQL. I can't figure out how JOIN and createQueryBuilder works in TypeORM. I have a Response table with a user_id field,...

js/app/js file net::ERR_ABORTED 404 (Not Found)

I'm setting up an authentication in laravel5 , but js and css don't work on my web page <script src="{{ asset('js/app.js') }}"></script> GET http://127.0.0.1:8000/js/app.js net::ERR_ABORTED 404...

Azure MySQL server allow disable 'sql_mode=only_full_group_by'

I have an application that runs on node.js and queries the database hosted on Azure MySQL server, I have encountered an error message during a query with group by "...this is incompatible with...

Mysql2::Error: Out of sort memory, consider increasing server sort buffer size using docker-compose.yml

Hi I'm building a rails app and I imported lots of data and inserted into the database. Some tables are okay and some tables have some errors that says out of sort memory. SQL ERROR Mysql2::Error:...

java.sql.SQLException: Out of sort memory, consider increasing server sort buffer size

I am trying to run this query using java with JDBC: SELECT * FROM jobs WHERE 0=0 # find all occurrences of the search string + any component of the search string OR job_title COLLATE...

MySQL Running SQL Script error - [WinError 32] The process cannot access the file because it is being used by another process:

I am getting an error while running a SQL script to load data. Error is pasted below: Preparing... [WinError 32] The process cannot access the file because it is being used by another process:...

ORDER by multiple queries in MySql

I am trying to build a chat list page where latest sent/received contact is shown at the top from one table. For this, I have a table smshistory where i store sent/received sms with numbers where...

How do I disable SSL Requirement in MySQL Workbench?

It seems that SSL connection is required to use MySQL Workbench, and I don't think this is the case with previous versions. I remember SSL connections used to be optional. After I updated it, all...

How to write a sql query to find maximum weekly working hours?

I am accessing a Company's Database trying to help the HR to forward the Ace of the Week details for rewarding purposes. The “Gate_Logs” table has the below columns. a. Employee ID - A 4 Digit...

Relevant tags