RE: probably a stupid question

2003-06-18 Thread Andy Eastham
> Subject: probably a stupid question > > > Hey, > Here is what I want to do > I have 2tables > let's say table A and B for simplicity. > in table A I have column id > and in table B I have column A_id > > I insert a new value into table A insert into a values(NUL

Re: probably a stupid question

2003-06-18 Thread Don Read
On 18-Jun-2003 Jonas Geiregat wrote: > I insert a new value into table A insert into a values(NULL) > Since id is auto_incremenet and the primary key it will have an auto > value. > Now I want that the column A_id contains that id nr. > I could query for the biggest id in column A and insert t

RE: probably a stupid question

2003-06-18 Thread Twibell, Cory L
Check out LAST_INSERT_ID() in the manual -Original Message- From: Jonas Geiregat [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 12:26 PM To: 'Mysql' Subject: probably a stupid question Hey, Here is what I want to do I have 2tables let's say table A and B for

probably a stupid question

2003-06-18 Thread Jonas Geiregat
Hey, Here is what I want to do I have 2tables let's say table A and B for simplicity. in table A I have column id and in table B I have column A_id I insert a new value into table A insert into a values(NULL) Since id is auto_incremenet and the primary key it will have an auto value. Now I want tha

RE: [PHP] Re: A stupid question...

2002-03-11 Thread Tim Ward
hat one. Tim Ward Internet chess www.chessish.com <http://www.chessish.com> -- From: Chuck "PUP" Payne [SMTP:[EMAIL PROTECTED]] Sent: 11 March 2002 02:59 To: Cary; mysql lists.mysql.com Cc: PHP General Subject: Re: [PHP] Re: A stu

Re: [PHP] Re: A stupid question...

2002-03-10 Thread Kim Kohen
G'day Daren > $query = "SELECT * FROM tbl_name WHERE LEFT(last_name, 1) == '$letter')"; > NOTE: LEFT() is a "special" function, I'd consider it a derivative of > SUBSTRING() Does MySQL have a function that can selectively return words from a column? What I'm looking for is the equivalent of

RE: [PHP] Re: A stupid question...

2002-03-10 Thread Demitrious S. Kelly
lists.mysql.com Cc: PHP General Subject: Re: [PHP] Re: A stupid question... I want to sort by a letter in a colomn. Let say I want to sort the colomn last_name. I can do order by but I can do just the A's. http://www.myserver.com/mysort.php?Letter=A Like to create a link on a web "A&qu

RE: [PHP] Re: A stupid question...

2002-03-10 Thread Daren Cotter
---Original Message- From: michael kimsal [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 10, 2002 8:17 PM To: Chuck \ Pup\\ Payne Cc: mysql lists.mysql.com Subject: Re: [PHP] Re: A stupid question... Chuck "Pup" Payne wrote: > I want to sort by a letter in a colomn. Let say I wan

Re: [PHP] Re: A stupid question...

2002-03-10 Thread michael kimsal
Chuck "Pup" Payne wrote: > I want to sort by a letter in a colomn. Let say I want to sort the colomn > last_name. I can do order by but I can do just the A's. > > http://www.myserver.com/mysort.php?Letter=A > > Like to create a link on a web "A" then sort only the last name are A. > > I hope t

Re: [PHP] Re: A stupid question...

2002-03-10 Thread Chuck \"PUP\" Payne
I want to sort by a letter in a colomn. Let say I want to sort the colomn last_name. I can do order by but I can do just the A's. http://www.myserver.com/mysort.php?Letter=A Like to create a link on a web "A" then sort only the last name are A. I hope that's helps. I can order by, but I can't

Re: [PHP] Re: A stupid question...

2002-03-10 Thread Chuck \"PUP\" Payne
I want to sort my a letter in a set colomn. Let say I want to sort the colomn last_name http://www.myserver.com/mysort.php?Letter=A Like to create a link like A then sort only the last name ore what ever I want to sort by that letter. I hope that's helps. I can order by, but I can't so a sort l

Re: A stupid question...

2002-03-10 Thread Cary
At 08:24 PM 3/10/02, Chuck \"PUP\" Payne wrote: >Hi, > >I not a newie but I am not a pro at mysql either. I want to do a query by >letter(a, b, c..ect.). Is there a simple way to do it. I am writing in PHP. >So can someone please so me the how. I'm not totally sure what your looking for. If you

A stupid question...

2002-03-10 Thread Chuck \"PUP\" Payne
Hi, I not a newie but I am not a pro at mysql either. I want to do a query by letter(a, b, c..ect.). Is there a simple way to do it. I am writing in PHP. So can someone please so me the how. | Chuck Payne | | Magi Design and Support | | www.magides

Re: probably a stupid question but...

2001-07-08 Thread Don Read
On 08-Jul-01 Jonah Klimack wrote: > > What I don't want, is the same category name and > customerID twice, even if it does have an index column > that differentiates it from other rows. > > > I've tried this: > ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, > customerID INT UNSIGNED, > categor

Re: probably a stupid question but...

2001-07-08 Thread Jonah Klimack
> Use an index If you mean use a primary key to create a unique record regardless of the other data in the row, I've already done that. However I'm using that primary key as a means of creating a relationship with another table. What I don't want, is the same category name and customerID twice,

Re: Perhaps a stupid question about KEY...

2001-07-07 Thread Tonu Samuel
Jeremy Zawodny wrote: > On Sat, Jul 07, 2001 at 07:22:19AM -0700, Ken Sommers wrote: > >> Does it make any sense to create an index on the primary key? > > Primary Keys are automatically indexed. In fact, you might say that a > primary key is just a special type of index (it is). There are som

Re: probably a stupid question but...

2001-07-07 Thread Justin Farnsworth
Use an index. -- Jonah Klimack wrote: > > Hi > > I want to enforce unique records in one of my > tables. > > The table goes like this: > > ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, > customerID INT UNSIGNED, > categoryname VARCHAR(20) > > With customer ID pointing to a custome

probably a stupid question but...

2001-07-07 Thread Jonah Klimack
Hi I want to enforce unique records in one of my tables. The table goes like this: ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, customerID INT UNSIGNED, categoryname VARCHAR(20) With customer ID pointing to a customers table. I suddenly realized that one customer could input the same "category

Re: Perhaps a stupid question about KEY...

2001-07-07 Thread Jeremy Zawodny
On Sat, Jul 07, 2001 at 07:22:19AM -0700, Ken Sommers wrote: > > Does it make any sense to create an index on the primary key? Primary Keys are automatically indexed. In fact, you might say that a primary key is just a special type of index (it is). Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTE

Re: Perhaps a stupid question about KEY...

2001-07-07 Thread Ken Sommers
HI, Does it make any sense to create an index on the primary key? Ken - Original Message - From: "Paul DuBois" <[EMAIL PROTECTED]> To: "Fournier Jocelyn [Presence-PC]" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 06, 2001 3:49 PM

Re: Perhaps a stupid question about KEY...

2001-07-06 Thread Paul DuBois
At 12:14 AM +0200 7/7/01, Fournier Jocelyn [Presence-PC] wrote: >Hi, > >Is there any structural difference between a PRIMARY KEY and a UNIQUE key ? > >Thanks ;) > >Jocelyn Fournier >Presence-PC >www.presence-pc.com They're mostly the same, with these differences: There can only be one PRIMARY KE