Re: basic sql join question...

2005-05-29 Thread Philip George
On May 30, 2005, at 1:28 AM, [EMAIL PROTECTED] wrote: you can just play : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; select @total as "grand total"; works great. thanks very, very much. - philip -- MySQL General

Re: basic sql join question...

2005-05-29 Thread Philip George
On May 29, 2005, at 2:34 PM, [EMAIL PROTECTED] wrote: you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+-- +---+ | name |

Re: mysql and php

2005-05-29 Thread Philip George
mysql.sock is created by mysqld when it starts, and destroyed when it stops. haha. you're absolutely right. that doesn't make any sense. i wasn't thinking about the nature of socket files when i wrote that. now that i go back and read the post i was referring to, i think the poster was ac

Re: mysql and php

2005-05-29 Thread Philip George
On May 29, 2005, at 11:13 AM, [EMAIL PROTECTED] wrote: I get these: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (13) in /Library/WebServer/testpad/test.php on line 3 Warning: mysql_select_db(): Can't connect to local MySQL server th

Re: mysql and php

2005-05-29 Thread Philip George
: chown mysql:wheel /tmp/mysql.sock chmod 4777 /tmp/mysql.sock - philip On May 29, 2005, at 12:33 PM, Philip George wrote: try looking at these two pages: http://dev.mysql.com/doc/mysql/en/access-denied.html http://dev.mysql.com/doc/mysql/en/connecting-disconnecting.html search them

Re: mysql and php

2005-05-29 Thread Philip George
try looking at these two pages: http://dev.mysql.com/doc/mysql/en/access-denied.html http://dev.mysql.com/doc/mysql/en/connecting-disconnecting.html search them both for '2002' (multiple instances on one of the pages). there a couple suggestions for things to try. hth. - philip -- MySQL Gen

Re: basic sql join question...

2005-05-29 Thread Philip George
actually, i've decided this is sort of a moot point, since i can do this calculation in the client app. no sql required. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: basic sql join question...

2005-05-29 Thread Philip George
The join is irrelevant. Your join returns a resultset and you can just pretent that resultset is a single table: SELECT field1, field2, field3 FROM (very complicated join) AS simpletable GROUP BY ... WITH ROLLUP Just copy-pate your join into this and fix the fieldnames. aaahhh okay, i'm

Re: basic sql join question...

2005-05-29 Thread Philip George
http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. actually i should say that there are no examples of SUM() or AVG() -- or any of the other GROUP BY functions -- th

Re: basic sql join question...

2005-05-28 Thread Philip George
On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. - philip -- MySQL General Mailing List For list archives:

Re: basic sql join question...

2005-05-28 Thread Philip George
x27;ve tried with no success to use SUM() to do this. would i even use SUM()? if i could refer to the resultant table above in a subsequent select, that would be ideal. is there a way to do that (something like select SUM(@@result.subtotal);)? thanks. - philip On May 28, 2005, a

basic sql join question...

2005-05-28 Thread Philip George
is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
thanks. - philip On May 28, 2005, at 10:08 PM, Paul DuBois wrote: http://dev.mysql.com/doc/mysql/en/silent-column-changes.html At 21:29 -0500 5/28/05, Philip George wrote: when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50

char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50) DEFAULT NULL, lastname varchar(50) DEFAULT NULL ); ...and then use describe to show what i've got: mysql> describe person; +---+-+--+-+-+

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
ahhh... thanks. good to know. - philip On May 28, 2005, at 8:57 PM, Paul DuBois wrote: At 20:50 -0500 5/28/05, Philip George wrote: ya, i just meant when you go to the main table of contents page for the docs: http://dev.mysql.com/doc/mysql/en/index.html ... there's no mention

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
, 2005, at 8:38 PM, Paul DuBois wrote: At 20:26 -0500 5/28/05, Philip George wrote: this is what i was looking for: SHOW CREATE TABLE tablename; for some reason it isn't on the main doc page. - philip http://dev.mysql.com/doc/mysql/en/show-create-table.html On May 28, 2005, at 8:19 PM

Re: exporting table structure/data in mysql?

2005-05-28 Thread Philip George
thanks. - philip On May 28, 2005, at 8:25 PM, Paul DuBois wrote: At 20:19 -0500 5/28/05, Philip George wrote: what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREATE TABLE statement)? ..so that i'

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
this is what i was looking for: SHOW CREATE TABLE tablename; for some reason it isn't on the main doc page. - philip On May 28, 2005, at 8:19 PM, Philip George wrote: what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterat

exporting table structure/data in mysql?

2005-05-28 Thread Philip George
what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREATE TABLE statement)? ..so that i'll end up with something that can be put in a .sql script for later imports if needed. thanks. - philip -- MySQL General Mailing List F

proper varchar size for uuid storage

2005-05-28 Thread Philip George
i see a lot of variation out there on this subject. some people are using varchar(64), some varchar(32), and some other non-base2 widths. what is the proper width? i count 36 characters below, including the four dashes. mysql> select uuid(); +--+ | uuid()