CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 SQL problem

Print topic Send  topic

Author Message
voxter

Posts: 3
Posted: 01/25/2006, 6:14 AM

To start from the very beginning :

1. There are 2 user groups - members (group_id=2) and non-members (group_id=1)
2. I have a registration form in which applicants need to chose a refferal from members listed in the database with the help of a listbox.

My query looks like that

SELECT first_name, last_name FROM users WHERE group id > 1

What I get is the last name listed in the listbox and the first name inserted in the refferal field in the database.

I would appreciate any suggestions. Thanks
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 01/25/2006, 7:42 AM

voxter
I am assuming that you are using PHP and MySQL. Here is one possible solution. Use this select statement instead:

Select id, concat(first_name,' ',last_name) as member from users where group id > 1

In the SQL statement the field id is the memeber id (which you can store in the bound column-for the listbox). The field member is a concatenation of first and last name (which you can display in the Text Column of the listbox). Hope this helps...

View profile  Send private message
voxter

Posts: 3
Posted: 01/26/2006, 12:57 AM

this time i can't even get any listings in the listbox... But maybe I just did something wrong (I am not very proficient with PHP and MySQL), so I would appreciate if you described the situation a little more detailed
View profile  Send private message
voxter

Posts: 3
Posted: 01/26/2006, 1:23 AM

Got it... Thank you very much...
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 01/26/2006, 6:48 AM

No problem voxter. Enjoy!!!!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.