Associative Array from MySQL

2001-12-09 Thread Nelson Goforth
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

Grouping some data, not grouping others?

2001-10-28 Thread Nelson Goforth
-- === 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

UPDATE or 'rewrite' table with SELECT?

2001-09-22 Thread Nelson Goforth
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

Data import sticks on auto_increment?

2001-08-17 Thread Nelson Goforth
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

Re: Formatting Price Field in my Table so 0.20 does not become0.2....

2001-08-17 Thread Nelson Goforth
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

Writing 100+ fields with Perl DBI

2001-07-31 Thread Nelson Goforth
-- === 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

Re: Writing 100+ fields with Perl DBI

2001-07-31 Thread Nelson Goforth
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

Re: Text how many characters

2001-07-22 Thread Nelson Goforth
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

Re: Storing survey(s) data?

2001-07-20 Thread Nelson Goforth
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

Storing survey(s) data?

2001-07-19 Thread Nelson Goforth
-- === 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

RE: Aggregate Functions - Count, Sum

2001-07-11 Thread Nelson Goforth
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

Aggregate Functions - Count, Sum

2001-07-10 Thread Nelson Goforth
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

Re: MySQL ISP

2001-07-09 Thread Nelson Goforth
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

total rows in table?

2001-07-08 Thread Nelson Goforth
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

RE: total rows in table?

2001-07-08 Thread Nelson Goforth
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

Localization with MySQL

2001-07-07 Thread Nelson Goforth
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

Re: Help please, create table, and set Auto field

2001-07-04 Thread Nelson Goforth
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

RE: SELECT form element with PHP/MySQL

2001-07-03 Thread Nelson Goforth
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

SELECT form element with PHP/MySQL

2001-07-02 Thread Nelson Goforth
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

Lat/Long storage?

2001-06-25 Thread Nelson Goforth
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