Re: [PHP-DB] storing serialized() data in the db -> can it be queried on?

2003-08-18 Thread Bob Hall
a really powerful overriding reason, the best solution is to have a seperate table for the array, with a foreign key that points back to the record in the original table. That will make retrieving data a lot easier; e.g. you can do a query with a join and "WHERE thisField = 'j

Re: [PHP-DB] Is the query I need even possible?

2003-03-19 Thread Bob Hall
.visitor_id GROUP BY v1.page_id, v1.visitor_id HAVING Max(v1.timestamp) = Max(v2.timestamp); Substitute Min() for Max() to get the earliest visit. Bob Hall -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] group by get last record

2003-03-16 Thread Bob Hall
AVING Max(s1.Moment) = Max(s2.Moment); BTW, you can't assume that your original statement will always return the first slide. People who have tested GROUP BY statements say that the value returned from columns with no aggregate function is somewhat random. Bob Hall -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] How can recommend a book for SQL and DB design

2002-01-15 Thread Bob Hall
book sounds like the best bet, when it comes out. Bob Hall -- Know thyself? Absurd direction! Bubbles bear no introspection.-Khushhal Khan Khatak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: [PHP-DB] Use of Like

2001-07-09 Thread Bob Hall
e language section of the MySQL online manual. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak MySQL list magic words: sql query database -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: [PHP-DB] ORDER BY in MYSQL ? 8(

2001-05-18 Thread Bob Hall
t the end. I know that I have to use the Danish character set to get the correct sort for Norwegian. Check the manual for instructions on changing character sets. It's been a while since I've done it, and I no longer remember how. Bob Hall Know thyself? Absurd direction! Bubbles bear n

Re: [PHP-DB] SELECT question

2001-05-17 Thread Bob Hall
. > >Thanks! > >Nick Sir, use GROUP BY and an aggregate function. SELECT items.itemId, description, link, Sum(qty) AS sum_qty, price FROM carts, items WHERE carts.custId = '$custId' AND items.itemId = carts.itemId GROUP BY itemId; Bob Hall Know thys

Re: [PHP-DB] Help with mysql and php 4.03

2001-05-09 Thread Bob Hall
move the ON conditions to the WHERE clause. FROM city, state_prov, area_phone, ... WHERE state_prov.state_id = city.state_id AND area_phone.city_id = city.city_id AND ... Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak MySQL list magic words: sq

Re: [PHP-DB] Select statements - A Quest !!!

2001-04-28 Thread Bob Hall
which contains the child records. I might be able to figure it out if know what a kaizen is. You haven't declared any primary keys on the employee table, and you didn't say which DBMS you're using. In general, pattern is SELECT dept, Count(p.something), Count(c.something_

Re: [PHP-DB] Re: PostgreSQL versus MySQL

2001-04-11 Thread Bob Hall
>On Mon, 9 Apr 2001, Bob Hall wrote: > > > > MySQL is providing an SQL frontend to a > > >bunch of tables and indices, that is it ... it is up to the programmer to > > >handle the "managing of data" part where it revolves around being > >

Re: [PHP-DB] Re: PostgreSQL versus MySQL

2001-04-10 Thread Bob Hall
f better SQL compliance. (Although the whole team seems to share Monty's confusion over transactions.) I'm rooting for PostgreSQL to become the open source app that ate Oracle. MySQL will never be capable of that, but I don't think it needs to be. There will always be a niche for

Re: [PHP-DB] Re: PostgreSQL versus MySQL

2001-04-09 Thread Bob Hall
>On Sun, 8 Apr 2001, Bob Hall wrote: > > > Doug, > > > > You've posted your usual good sense, combined with one statement I > > strongly disagree with. > > > > >One of > > >these products is a relational database management system

Re: [PHP-DB] Re: PostgreSQL versus MySQL

2001-04-08 Thread Bob Hall
Doug, You've posted your usual good sense, combined with one statement I strongly disagree with. >One of >these products is a relational database management system. The other is a >quasi-SQL-like-front-end-to-systems-of-indexed-files that has never >concerned itself with things like standards

Re: FW: [PHP-DB] SELECT MAX(ID) PLUS 1

2001-03-29 Thread Bob Hall
the project is in trouble. There's a limit to how much a programmer can do to solve problems caused by bad database design, as you have discovered. Bob Hall >Can anyone help me on this one >Lisa >-Original Message- >From: Walter [mailto:[EMAIL PROTECTED]] >Sent: Wedne

Re: [PHP-DB] Tricky database query involving two tables, much more detail

2001-03-01 Thread Bob Hall
may occur again and again in B, both >matching "thing" and not matching "thing". I want to know >specifically the opposite of the first query (i.e. the opposite of >"what does match the "thing" in B"), which is a bit different. > >Thanks much

Re: [PHP-DB] Join causing Error?

2001-02-25 Thread Bob Hall
;s not the problem, since you say you did it in the query that worked, but I don't see the point. Bob Hall >Can anyone tell me why this: > Line 282mysql_select_db("centraldb",$db); > Line 283$qorder++; > Line 284$result = mysql_query("SELE

Re: [PHP-DB] MySQL execution order...

2001-02-23 Thread Bob Hall
Sir, it would help to see the INSERT statement and the table definition. Bob Hall >I sent this message to the "general" list yesterday, and have yet to get an >answer (except for that Spanish "Snow White" virus attempt from Peru). > >I'm trying to downloa

Re: [PHP-DB] composite keys

2001-02-20 Thread Bob Hall
PRIMARY KEY () This is covered in the online manual. If you want to use an auto_increment field as the primary key, you can insure uniqueness in the SportName and TeamName fields by declaring a UNIQUE INDEX in the same way. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspecti

Re: [PHP-DB] rewriting this query to remove IN

2001-02-12 Thread Bob Hall
anybody have any ideas, thanks for this guys. Any help is much >appreciated. > >Scott Mebberson Sir, I can't offer suggestions without knowing what the subquery is. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak -- PHP Da

Re: [PHP-DB] the SET datatype

2001-02-09 Thread Bob Hall
s table B changes. Is there anyway of doing this? > >Please help? > >[EMAIL PROTECTED] No sir. The members of the SET have to be entered as constant values in the column definition. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak --

RE: [PHP-DB] foreign key problem

2001-01-31 Thread Bob Hall
Yes sir, you are correct. Thank you for correcting me. In practice, a NULL in a foreign key almost always means an orphan record. In most applications the designer will want to use the NOT NULL constraint. Bob Hall >A foreign key value can be null, if it suits the data application - or t

Re: [PHP-DB] foreign key problem

2001-01-30 Thread Bob Hall
/foreign key relationship, you will have to specify what RDBMS you are using. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: [PHP-DB] Query Access DB by date

2001-01-11 Thread Bob Hall
s it doesn't know what >I'm asking for. I'm confused. Thanks. The pound sign is correct. If your query doesn't work with the pound sign, then the problem is elsewhere. Post an example of your code. Bob Hall Know thyself? Absurd direction! Bubbles bear no introspection.