Category "mysql"

Is current location within radius of items stored in a table?

I have a table that stores longitude / latitude / radius ( miles ) per row. What I am trying to figure out is how to select ONLY the rows that my current point

find server ip by sql

How can I get server ip (host) by a MySQL query? an sql like this: SELECT @@SERVERIP I want to connect to my db by netbeans, and I can't use 'localhost' for

How to use LOAD_FILE to load a file into a MySQL blob?

I tried to load a file into a MySQL blob (on a Mac). My query is INSERT INTO MyTable VALUES('7', LOAD_FILE('Dev:MonDoc.odt')) No error appears but the file

MySQL equivalent of Python's triple-quoted strings?

Using Python's triple-quoted strings I can define strings containing ', backticks, or " without having to care about it: hello = """ This strin

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

I get this error whenever I run this: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given The Code: $amn = mysql_q

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