Hi,
I want to store several fields from a html form in one table field. Here is the source code for the form. This is only part of the form, the form tags are there. Attached is a screenshort from this part of the form.
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><input class="field checkbox" type="checkbox" value...
I have a table called order which contains columns id, user_id, price. I would like to select each user's most expensive order - the order for which that user paid the highest price. I want to select order.user_id and order.price in the same query.
...
Hi guys,
What I would like to achieve here is a user selects an operator, e.g. +, >, <, >= etc. and uses this in a Select statement in PHP.
MY HTML code:
<label for="grade">Grade: </label>
<select name="operator" id="operator">
<option value="">Select one</option>
...
Hello everybody,
Here is my sql statement
SELECT DISTINCT article_categories.category_id,
article_id,article_title,article_intro,article_content,
category_name_ar
FROM articles,article_categories
WHERE articles.category_id=article_categories.category_id
AND article_type='admin'
AND category_case='active'
GROUP BY a...
I am trying to UPDATE a MySQL table using Python's MySQLdb module. Although the query seems fairly simple it just won't update the information. Here is my code:
for username,info in users.iteritems():
if info[0] > 0 and info[1] > 0:
month = 8
year = 2010
cursor.execute("""
UPDATE users_disk
SET
...
Hi Stack Overflow,
What's a good solution for modeling an existing and very complicated MySQL schema. Preferably with the following features:
completely visual
drill down on click
shows keys, indexes
gives sample data per field*
*as fields aren't always intuitively named
Thanks!
Emile
...
Hello,
I would like to implement a basic versioning system in a MySQL table. Let's imagine a simple table with 2 columns: name (pk) and price. I thought I would simply add a column 'version' and add it to the primary key. Then I would catch all the UPDATE's and do an insert instead, incrementing the version number.
First, is this pos...
Consider the following table:
mysql> select * from vCountryStatus;
+-------------+------------+------+---------+--------+-----------------+
| CountryName | CountryISO | Code | Status | Symbol | CurrencyName |
+-------------+------------+------+---------+--------+-----------------+
| Brazil | BR | 55 | LIVE | BRL ...
I have a varchar(384) to store emails in a MyISAM table and I want check when the email exists but the index length limit is 333 bytes (because I'm using utf8 (1000 bytes/3 bytes)).
Then what's the best way to search if a specified email exists, using a FULLTEXT index or creating another field with the email md5-hash in a BINARY(16) (wi...
Hi,
is there a way to get s.th. like a connection id of a PDO connection connected to mysql?
...
i have a table which has big int column used for storing the time stamp.The time stamp value which we are getting from our application is 13 digit number like 1280505757693.And there are many rows in this table right now probably more than half a million entries.Should i use Index on timestamp column or not ???? Any suggestions ?
...
I am willing to implement website where will be top 10 best members' pictures or something like that. Before voting for pictures or uploading pictures people will have to register first. But how could I protect my website from multiple accounts? Store IPs to database? But will it help me while there thousands proxies out there? What shou...
I want to prepare my database for sharding in the future. But right now I only need 1 node.
What I'd like to do is to shard the database into virtual shards, say 12 shards, and put all of them onto the same server node for now.
And when I need to scale out, I could just then get a 2nd server and move 6 of the 12 virtual shard onto the ...
SELECT rel.*,o.*,sr.*,sq1.*, (SELECT COUNT(*) FROM survey_questions sq
JOIN survey_answers sa
ON sa.iQuestionId = sq.iQuestionId WHERE sq.iQuestionId = '50') AS total_scale
FROM survey_questions sq1
JOIN survey_response sr ON sr.iQuestionId = sq1.iQuestionId
JOIN observer o ON o.iObserverId = sr.iObserverID
JOIN relationsh...
Hi, I'm trying to select multiple values from 2 columns. I can get the query working with 1 column, eg:
SELECT *
FROM table
WHERE
town IN ( 'Oxford' , 'Abingdon' )
However, I want to do something like:
SELECT *
FROM table
WHERE
town IN ( 'Oxford' , 'Abingdon' )
AND type IN ( 'type1','type2')
but I can't get it to work.
Ba...
I have a java program that connects to a MySql database and it's working fine.
Now I want to convert it to a C# program, but I keep getting the error "Unable to connect to any of the specified hosts".
I've already followed the following solutions:
Connect to MySql with C#
C# MySqlConnector
Configure the ODBC DNS
And the reference to M...
Hi, I want to update a column by comparing each row to all other rows in the table but I cant figure out how to distinguish the column names in the row being updated with the rows being searched through.
Here's a simplified example...
people:
+--------+-----+----------------+
| name | age | nameClosestAge |
+--------+----...
I have a table with the following (I've sorted it by date):
ID prodId date
16 532 2015-08-17
19 535 2014-08-18
18 534 2011-08-17
27 48 2010-08-26
26 1541 2010-08-25
25 1541 2010-08-21
24 1540 2010-08-20
21 48 2010-08-19
20 48 2010-08-18
17 53...
In my table dates are stored in the format "2010-08-26 09:00:00" so yyyy-mm-dd. I'd like to select all fields that have a date field that is "today", so between 2010-08-26 00:00:01 and 2010-08-26 23:59:59.
Just using larger and smaller than operators does not work, does MySQL have some built in date comparison functions that can do this...
I've made a test program that is basically just a textarea that I can enter characters into and when I click submit the characters are written to a MySQL test table (using PHP).
The test table is collation is UTF-8.
The script works fine if I want to write a é or ú to the database it writes fine. But then if I add the following meta s...