Category "mysql"

SQL query to find count of males and females city wise

Let's say we have the following table: city gender abc m abc f def m Required output: city f_count m_count abc 1 1 def 0

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

Laravel Multiple Data Insert Error SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'unit_id' at row 2 (SQL: insert into p

How to display the results of two queries side by side?

In mysql, I need to display the results of these two queries, side by side, not vertically (when using UNION). First query: SELECT SUM(cod = 'teste') as Cod

Post Form Data To phpmyadmin Database

I need to post data from a website (HTML5 based) to a database on PHPMyAdmin. I have the database created as sewcute and a table named members. I'm using XAMMP

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

I have a little problem with my if(isset($_POST['submit'])) code. What I want is some echos and a table to not appear when the script is open but I do want it t

load data local infile ERROR 2 file not found

I've been ramming my face against this sql error for about 45 minutes, and I have a feeling it's going to be something silly. I'm trying to load a .txt file in

HTML and PHP in one file

I'm a PHP newbie trying to sort some basics out. I have a user-form that leads to a mysql select query, which works fine. Every tutorial I have found so far has

json_encode turns array into an object

I am have created a 'liking' system for a site but I'm having a bit of trouble with json_encode and json_decode. I use arrays to store who has liked a post, so

How do i import database in mysql ? I am using laradock and I am not being able to increase the import file size of mysql

I am not being able to increase the file upload size in phpmyadmin. I am using laradock and I have already increased post_max_maxsize and upload_max_filesize va

How do i import database in mysql ? I am using laradock and I am not being able to increase the import file size of mysql

I am not being able to increase the file upload size in phpmyadmin. I am using laradock and I have already increased post_max_maxsize and upload_max_filesize va

The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception

I have ASP.Net MVC site. Technology Stack ASP.Net 4.6 C#.Net EF 6 MySQL -Database While I am trying to generate the database using Nuget command:- Enable-Mi

MySQL upgrade fails on Ubuntu 16.04

I have Ubuntu 16.04 running (clean install - no upgrade). MySQL is running fine - but I get this error when I try to update MySQL: apt-get install Reading pack

Inserting multiple rows in mysql

Is the database query faster if I insert multiple rows at once: like INSERT.... UNION INSERT.... UNION (I need to insert like 2-3000 ro

How can I select the row with the highest ID in MySQL?

How can I select the row with the highest ID in MySQL? This is my current code: SELECT * FROM permlog WHERE max(id) Errors come up, can someone help me?

MySql Error 1261: Row 1 doesn't contain data for all columns

I am trying to do a load data infile to a database. The only issue I have is I am getting a Error 1261. I was getting an incorrect datetime value error earlier

How to fully convert JSP scriptlet into JSTL?

I am new to JSTL, could someone please tell me how to convert below JSP and HTML code to full JSTL with no scriptlet in the page? I'd also be grateful for sugge

How to call a function inside of another function in PHP OOP

I'm making my own custom CMS using PHP Object Oriented... I have made a page where a main admin of a site can add another admin. In order to do this I made this

Can't start MySQL, port 3306 busy

I'm trying to start MySQL from XAMPP (under Windows Vista), but it's saying that's port 3306 is busy. What would be the best way with check what application is

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

I am getting the following error message on the code below (which is at the end of the query): Warning: mysql_num_rows(): supplied argument i

CURRENT_DATE/CURDATE() not working as default DATE value

Pretty straight forward question here, I think this should work but it doesn't. Why doesn't it? CREATE TABLE INVOICE( INVOICEDATE DATE NOT NULL DEFAULT CURR