Category "mysql"

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

Checking if a table has any rows, and return string if it doesn't

If there is a table, test, how can we return "No data" if the table has only title but no other rows? IF (SELECT 1 FROM test) < 1 THEN (SELECT ' No data');

Fatal error: [] operator not supported for strings

I'm getting information from database, saving it in array and echoing it in a form with loop structure and I'm having problems when I try to save the modified i

Volume not persistent in Google Cloud

I'm trying to build a mysql pod on Google Cloud. However, when I create a database and then restart the pod, the database that I created is not persisted. I fol

Second select load from database after first one is selected

I have 2 select items. In the first one I'm loading the options from a MySQL database table using PHP. The second one I want to load the fields from another t

How do I connect Dreamweaver to a MySQL Database?

I've been trying to connect Dreamweaver to a MySQL Database for a while. These are the login data: $mysql_host = "mysql16.000webhost.com"; $mysql_database = "

Python BeautifulSoup Empty Rows in CSV File

I am working on a scraper to pull street names and zip codes from a site and all of that is working great and it builds a CSV file just fine for me. But when I

Database design, variable number of columns [closed]

I have a simple application in which users submit data into a table. There are currently 3 fields the user can pass values to at the moment.

How to add a primary key to a MySQL table?

This is what I tried but it fails: alter table goods add column `id` int(10) unsigned primary AUTO_INCREMENT; Does anyone have a tip?

"Database hosts array is empty." after deploying Laravel project on AWS Elastic Beanstalk

I deployed my project to an AWS EC2 instance using Elastic Beanstalk. I used this tutorial https://www.youtube.com/watch?v=ISVaMijczKc as a reference while depl

MySQL error #1054 - Unknown column in 'Field List'

Whenever I try to input data into my tblorder I get the error message #1054 - Unknown column 'FK_Customer_ID' in 'field list'. I have tried breaking my code do

SQL to convert multiple rows into a single row of variable length

I am writing a module for drupal6/PHP5 using MySQL (and optionally PostgreSQL). To represent arbitrary sample properties and instrument readings in an experimen

How to correctly set Mock Row and Query for go-sqlmock

I'm setting up testing in golang. I use go-sqlmock to test mysql connection. But sqlmock.NewRows and mock.ExpectQuery does not work well with error. I want to k