Re: record pointer
| From: | elk dolk | Date: | Thu, 05 Jul 2007 19:37:17 +0000 |
| Subject: | Re: record pointer | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43748@lists.php.net to get a copy of this message | ||
O.K. the id column is primary key and it is auto_incerment .I think my explanation was not clear
enough :
this is my query : SELECT * FROM table WHERE ID=$ID
this will find the record with the specified ID and I will be able to see it, now I want to be
able to scroll up and down to all the records that belong to the same cat(egory)!
Frank Flynn <frank@declan.com> wrote:
This is standard SQL:
SELECT id, name ,cat FROM catTable WHERE cat = 'zzz';
This would return something like
----------------------------
id name cat
----------------------------
1 fred zzz
5 fefe zzz
18 Mr. Puddles zzz
27 Moris zzz
and so on
Your column 'id' is the pointer you're looking for. You should define it as
'PRIMARY KEY' and perhaps AUTO_INCREMENT (this means MySQL will automatically assign a
value to it).
Hi all,
My DB has the following columns: id, name ,cat. I want to select a cat i.e. cat=zzz when the
query is finished I should see a specific record within this cat which is defined by id, like
id=yyy
Any idea how to do this? Is there a function or something like record pointer in MySQL ?
cheers
---------------------------------
Get your own web address.
Have a HUGE year through Yahoo! Small Business.