Topic on Project:Support desk

[RESOLVED] Confusion with Database Access system.

3
205.175.225.22 (talkcontribs)

I'm having trouble figuring out the syntax for the database access system. The thing that's giving me trouble is that I want to do a 'SELECT DISTINCT' query but I can't figure out how to do that. It doesn't talk about it on the Manual:Database Access page, and on the Discussion:Database Access page someone mentions it but isn't clear on how they got it to work.

I'd like to execute the query: "SELECT DISTINCT wl_user FROM watchlist WHERE wl_title ='$EMpageTitle'"

Please and thank you for your help :)

Ciencia Al Poder (talkcontribs)

Select function is as follows: function select( $table, $vars, $conds = '', $fname = 'Database::select', $options = array(), $join_conds = array() );

You need to pass to $options an array containing the string 'DISTINCT'.

That's what the talk page says.

$options = array();
$options[] = 'DISTINCT';

or

$options = array( 'DISTINCT' );
Reply to "[RESOLVED] Confusion with Database Access system."