help with extracting from a database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

help with extracting from a database

Post by m3mn0n »

Here is the table

-----------------------
|ID-|Col1-|Col2-|
|--------------------|
|1--|Wrd1-|Wrd2|
-----------------------

maybe it's because i'm sleepy as hell or too much stress, but i can't figure this out...

How would i do a query if Wrd1 was picked, it shows *only* Wrd2?

thx
User avatar
9902468
Forum Commoner
Posts: 89
Joined: Thu Jun 06, 2002 6:39 am
Location: Europe

Post by 9902468 »

Explain more...
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

This is a translation type search engine.

If a user inputs a a word into a form where the value = wrd1 and sends it to the handle page, i want on the handle page to show only wrd2.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Code: Select all

SELECT col2 FROM table WHERE col1 = 'string'
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

thx much! 8)
Post Reply