Some answers within your message.

I would suggest you to browse the reference manual.

Bernard

On Thursday 05 February 2004 17:27, /dev/null wrote:
> wow, nice product.  Pretty easy to use and install - I like it.
>
> I know enough about SQL and databases to just about break any flavor of
> them I put my hand on ;-).  A couple of pointers would be great.
>
> I'm creating a handfull of tables that will inter-depend on eachother,
> using it within php.  I have three basic questions:
>
> 1.  Some of the tables have a unique ID, each new record should get the
> next number available.  Is there an easy data type that will do this for
> me, or do I need to get a record count myself and use record count + 1 when
> I insert a new row?

You can use an AUTO_INCREMENT column
See URL: http://www.mysql.com/doc/en/CREATE_TABLE.html for an explaination
>
> 2.  Some of the tables will need a timestamp of the exact date/time the
> record was added.  Does timestamp do this, or again do I need to get time(
> ) and use that value on the insert myself?

I would suggest a DATETIME type and use now() when inserting new record.

>
> 3.  Some of the IDs from one table are used in another table, for example I
> have an accounts table and a sites table.  Each account can have several
> sites, and each site entry has an "account" field that has the account ID
> (from question 1) to tell who the account owner is.  Isn't there a joint
> query that I can run that is like 'SELECT * FROM `sites` WHERE `AccountID`
> = ( SELECT `ID` FROM `accounts` WHERE `Name` = 'First Last' )'???  Or do I
> need to run the inner select and get the ID myself, then run the outer
> select?  I admit, I know just enough SQL to wipe the database and drop all
> the tables ;-), so any help would be greatly apreciate.

You want to establish a REFERENCE.
Look at the same URL as above for information.

>
> Thanks!
>
> /dev/null

-- 

Bernard Clement
Info-Electronics Systems Inc.
Technical Director
phone: 514-421-0767 ext: 231
fax:  514-421-0769
email: [EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to