Single field database query

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Thu Aug 25, 2011 9:01 pm

Single field database query

Postby nreese » Thu Aug 25, 2011 9:07 pm

Hi all,

This sounds real dumb, but I can do db queries to get multiple rows, but I just can't work a pg_select or something like that to just give me one single field from the database (I just want one item from a lookup table). Could some please sling me a working bit of code that does that?



User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Single field database query

Postby egami » Fri Aug 26, 2011 4:09 am

$query = "SELECT fieldname FROM table WHERE fieldname = 'value' LIMIT 1";

Return to “Other Database Engines”

Who is online

Users browsing this forum: No registered users and 1 guest