On Thu, Jan 16, 2003 at 05:57:30PM -0600, matthew simpson wrote:
> I have freeradius 0.8.1 running against a MySQL database successfully.
...[snip]...
> 
> Do I need to patch the sql handler to do this, or is there a way to do it
> with what I already have?

This is usually where the more extended features of SQL kick in.

sub-selects will probably do what you want here:

select id.Username,Attribute,Value,op FROM radcheck WHERE Username IN 
(select Username from masteraccounts WHERE AccountStatus IS NOT '0');

edit sql.conf and replace the various fields with the variable names
appropriately, and you should end up selecting entries that only have a
non-zero accountstatus.

you may need to test it manually a little in mysql to make sure you've
got the syntax correct before testing it in freeradius.

http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html has more info on
the subject

look into using JOIN too, but beware, that joins can take a large amount
of memory and processing power, unless you're careful about your usage.

Hope that helps
Andrew Pilley

> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to