I may not be asking this in the best way possible but i will try my hardest. Thank you ahead of time for your help:
I am creating an enrollment website which allows an individual OR manager to enroll for medical testing services for professional athletes. I will NOT be using the site as a query DB which anybody can view information stor...
I have added a record to my table which auto-increments the primary key. I am having no luck retrieving this new value. The MySQL documents say to use the SELECT LAST_INSERT_ID(); in a query. I have done this, but can't retrieve the results.
According the the metadata of the result set, the data type is BIGINT and the column name i...
I have a table called artists. Within it, there is a field for the artist name (artist_name). Then there is a field for SEO friendly artist name, we'll call it search_name.
I have over 40,000 artists in this table. So, I'd like to convert all artists names to search friendly. What is the best way to accomplish this? Not looking f...
I'm trying to finalize my design of the data model for my project, and am having difficulty figuring out which way to go with it.
I have a table of users, and an undetermined number of attributes that apply to that user. The attributes are in almost every case optional, so null values are allowed. Each of these attributes are one to o...
Hi,
I'm trying to select data from database using this code:
//DATABASE
ResultSet rs;
String polecenie;
Statement st;
String[] subj;
public void polacz() {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection pol=DriverManager.getConnection("jdbc:mysql://localhost:3306/testgenerator", "root", "pospaz");
...
Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
SELECT id FROM data_table WHERE id IN(56,55,54,1,7);
The results will come back using the default order by id. 1,7,54,55,56
When I want to keep the order used in the IN: 56,55,54,1,7
Is there a quick way to do this in mySQL or will...
Lets say I'm searching the field title, how would I set it up so you could use + and - on keywords on an SQL level?
...
Has anyone made Django work with myconnpy?
I've checked out http://github.com/rtyler/connector-django-mysql but
the author said it's very outdated and not supported.
If you've managed to make Django work with myconnpy, please share your
experience.
Thanks.
...
I want to write a MySQL statement like:
SELECT * FROM someTable WHERE someId IN (value1, value2, value3, ...)
The trick here is that I do not know ahead of time how many values there will be in the IN().
Obviously I know I can generate the query on the go with string manipulations, however since this will run in a loop, I was wonderi...
I have two tables that were built for two disparate systems. I have records in one table (called "leads") that represent customers, and records in another table (called "manager") that are the exact same customers but "manager" uses different fields
(For example, "leads" contains an email address, and "manager" contains two fields fo...
Lets say I have a table with 20 entries. They are sorted by date (date is a column name >_>) in descending order. How would I go about selecting ONLY the newest entry and the 15th oldest entry?
I am getting all 15 results by doing the following query
SELECT * FROM mytable m WHERE col1 = "zzz" ORDER BY date DESC LIMIT 15;
...
I'm a little lost as how to run two mysql queries as one(return one result set to be sorted etc).
I understand how to do multiple JOINS but need to combine the below which is more than just a multiple join - it would include a multiple where etc.
1st query
sql = "SELECT s.id, s.song_name
FROM `songs` as s
IN...
Hi, I want to start a project for facebook and the application will be like real-time multiplayer chess game. The problem I'm having is I have no idea how to store the data when a player moves one piece and update the new position in player2 browser. I'm gonna use PHP, MySQL for server side and jQuery for Client Rendering. The simplest i...
i have a User with attributes
User.id
i have an object with
Object.id,
Object.name
i have a category with
Category.id,
Category.name,
Category.user_id
i have an association table with
category_id, object_id
user HABTM objects
objects HABTM users
categories belong to 1 user
how can i write a query to return a list of all objects Us...
I'm putting together a system to track customer orders. Each order will have three addresses; a Main contact address, a billing address and a shipping address. I do not want to have columns in my orders table for the three addresses, I'd like to reference them from a separate table and have some way to enumerate the entry so I can dete...
I would like to make two drop downs. a start time, and an end time. Specifically, I only need months. I would like to, for example, choose January, and then March, and then have the database read that it is the these two months plus February.
Is there any out of the box migration that could work?
I'm guessing..
script/generate migrat...
Description
According to the explain command, there is a range that is causing a query to perform a full table scan (160k rows). How do I keep the range condition and reduce the scanning? I expect the culprit to be:
Y.YEAR BETWEEN 1900 AND 2009 AND
Code
Here is the code that has the range condition (the STATION_DISTRICT is likely su...
I use this code to upload image files in xammp server:
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 100000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . ...
When i run optimize table on a innodb table, i get this message instead. does it mean that the table has already been optimized, but in a different manner?
"table | optimize | note | Table does not support optimize, doing recreate + analyze instead |"
...
Alright, so I have a table outputting data from a MySQL table in a while loop. Well one of the columns it outputs isn't stored statically in the table, instead it's the sum of how many times it appears in a different MySQL table.
Sorry I'm not sure this is easy to understand. Here's my code:
$query="SELECT * FROM list WHERE added='...