1
builderb
mysql help
  • 2004/1/10 7:04

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


Does anyone know how to compare a variable against 2 columns in a table?

example:

Select * from xoops_table where column_1=$variable OR column_2=$variable

I looked for the answer on http://www.mysql.com/ and was unsuccessful.

I'm trying to create a listing in the db that can be cross-referenced in 2 categories.

Any help is appreciated.

-Builderb

2
Stewdio
Re: mysql help
  • 2004/1/10 7:18

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


I'm weak with sql skills, but have you tried the XOOPS wiki for any solutions?

http://wiki.xoops.org/

3
Mithrandir
Re: mysql help

If you are comparing two columns in the same table your SQL should work.

Login

Who's Online

921 user(s) are online (76 user(s) are browsing Support Forums)


Members: 0


Guests: 921


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits