This topic is locked

Searching across tables

10/30/2006 9:30:10 PM
PHPRunner General questions
G
gdude66 author

Hi,

I have a project with 5 tables the main table is

events

id - int autoincrement

staffid - int

student - int

reason - int

action - int

text
staff table has

idstaff - int autoincrement

username

firstname

surname
student table

idstaff - int autoincrement

code

firstname

surname
reason table

idreason - int autoincrement

reason
action table

idaction - int autoincrement

action
when I try a search on the event table by surname or firstname of student it won't return values as they are all numbers which correspond to the respective tables.

How can I get it to search the surname or code and get it to return all results in text and not numbers?

T
thesofa 10/31/2006

I assume you have a missprint there, you have idstaff in the student table, would it be idstudent?

Perhaps this article on searching lookup values will be some use?

To search on the event table you may need to make a VIEW in PHPR with inner joins to the other tables, if the article above does not work.

Cheers

HTH

Alexey admin 10/31/2006

Graeme,
you can try to combine your tables data in one SQL query with JOIN clauses. Then use this query for searching.

Don't forget to make changers in GetFullFieldName function to make searching work properly as described here:

http://www.xlinesoft.com/phprunner/docs/us...sql_queries.htm

G
gdude66 author 10/31/2006

Graeme,

you can try to combine your tables data in one SQL query with JOIN clauses. Then use this query for searching.

Don't forget to make changers in GetFullFieldName function to make searching work properly as described here:

http://www.xlinesoft.com/phprunner/docs/us...sql_queries.htm



Maybe I should read the instructions a bit more. Thanks Guys.