Category "mysql"

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

Laravel - How to properly generate unique slugs from article titles?

I need to generate unique slugs based on titles of articles. For matching slugs I want to append a number to the end to make them unique. I made this function b

SQLAlchemy secondary relationship not using JOIN

I created a Many to Many relationship on SQLAlchemy, but for some reason when I access it it's not emitting a JOIN clause, but rather selecting from a cross pro

Join the same table temporary table in MySQL

I like to join a temporary table in MySQL which fails, the idea quite simple: CREATE TEMPORARY TABLE temp_table LIKE any_other_table; -- srsly it does not matt