I have a MySQL query that I want to draw an associative array from -
but I want the 'key' to the array to be the identifying element of
the row, and I'm stuck on how to get what I want.
For instance:
Each row in the result set contains an id number, a keyword and a
count related to that
--
===
Nelson Goforth Lighting for Moving Pictures
01.303.322.5042 http://www.earthnet.net/~ngoforth/film
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual
My project has one table that is a list of keywords that apply to
another table Locations. At intervals I will run a script to count
the number of records in Locations that each keyword uses and store
that number in the Keywords table, so that I can show users how
many locations each keyword
Problem: I'm experimenting with using mysqldump to backup my data,
which seems to work ok. However, in recreating the tables I run into
a problem.
Using either LOAD DATA INFILE or mysqlimport methods I get the error
Error: Duplicate entry '102' for key 1
Field def: record_id SMALLINT
While there may be a way to manipulate this with MySQL, you may find
that the interface language is simpler. PHP and Perl both offer a
command 'printf' which allows you to heavily format a string or
number. Like:
printf(The price is $%.2f, today only, $sqlResultRow-amount);
would
--
===
Nelson Goforth Lighting for Moving Pictures
phone: 01.303.322.5042 pager: 01.303.634.9733
resume: http://www.earthnet.net/~ngoforth/film
-
Before posting, please check:
http
with 120 columns and
need to populate it, do you not want to do it with one insert
statement? What else?
--
===
Nelson Goforth Lighting for Moving Pictures
phone: 01.303.322.5042 pager: 01.303.634.9733
resume
According to _MySQL mSQL_, by Yarger et al (O'Reilly) the TEXT
datatype holds 64KB of data.
Since my math skills and understanding of character storate are,
well...wretched, someone should check me on this:
64KB = 64000 bytes = 64,000 characters (@ 1 character/byte),
(or better
valid for my approach.
--
===
Nelson Goforth Lighting for Moving Pictures
phone: 01.303.322.5042 pager: 01.303.634.9733
resume: http://www.earthnet.net/~ngoforth/film
--
===
Nelson Goforth Lighting for Moving Pictures
phone: 01.303.322.5042 pager: 01.303.634.9733
resume: http://www.earthnet.net/~ngoforth/film
-
Before posting, please check:
http
Don, thank you. The SELECT statement worked perfectly just as you
suggested. Though the books I have on MySQL are pretty good, trying
to figure more and more esoteric statements out is a bit of a
challenge, even just in terms of syntax.
Nelson
In looking via SELECT * FROM tickets, the
I'm trying to return several pieces of information from a small table.
Table is 'tickets':
idCHAR(50)
group CHAR(50)
issuedDATE
used DATE
'issued' and 'used' are NULL until a date is entered. The found set
is generally based on the 'group'.
I want the actual
I've been using a server called BigBiz for some years for several
different low-traffic websites. They offer a sandbox for developers
(so you have full CGI access) by somehow isolating each site from all
the others.
BigBiz offers Perl and PHP3 scripting, MySQL, a MajorDomo mailing
list and
I'd like to include a line in certain output lists like this:
Showing 97 contacts out of 324
Other than doing a SELECT...FROM CONTACTS and getting the count from
that result and THEN doing a SELECTWHERE for the results I
actually want to see, is there some more efficient way of
I thought mysql_numrows(result_identifier) - which I'm using to get
the number of rows in the found set - was ONLY to get the number of
rows in the result set. What I'm after is how to get the number of
rows in an entire table without doing a search to find everything in
the table (concerned
I'm working on two projects for which I'm trying to build in
functionality to localize or internationalize later.
For one project, a large chunk of text would be translated into an
unknown number of languages. For this I'm allowing the text to be a
'text' field in a record, with other fields
CREATE TABLE namelist (
name CHAR(60),
id SMALLINT AUTO_INCREMENT)
You will find much useful information at http://www.mysql.com - check
the documentation section. I also use the O'Reilly book MySQL and
mSQL by Yarger, Reese and King, which has detailed
Thanks to Gerald, Werner, Gerlinde and Josh for help with the SELECT
form element. Gerald's was the simplest, most pragmatic solution,
but I ended up figuring out something that was a bit more like
Gerlinde and Josh suggested, but saving on a real 'if-then-else' loop
and doing it all in one
for any help.
Nelson
--
===
Nelson Goforth Lighting for Moving Pictures
phone: 01.303.322.5042 pager: 01.303.634.9733
resume: http://www.earthnet.net/~ngoforth/film
I need to store latitude and longitude in a MySQL table. It needs to
allow human entry. Do you have a preferred storage technique for
these numbers?
Nelson Goforth
--
-
Before posting, please check:
http://www.mysql.com
20 matches
Mail list logo