View Full Version : php search, results page

Aug 1st, 2008, 06:50 PM
Bare with me, there are alot of things going on with what I need done and I'm not sure how to word it all. But here it goes.

I build login and restriction scripts using dreamweaver, but dreamweaver can't help me know. I need a couple scripts or 1 which ever is best. the script I need needs to search a database for reports made and display the results (simple enough even for a noob like me) but it also needs to limit the results according to the logged in user. Each user has a company id number and the results can only show the reports made by their company(this is where I'm lost). The user will search by date. Also, in the result is a column called driver_id, I need that to return the driver name from a different table(some kind of join but I can't get it to work).

If there is anyone that can do this or help me do this, please let me know.

Aug 2nd, 2008, 01:24 AM
Assuming your using MySQL:

$query = "SELECT * FROM tableName WHERE company_id = '$company_id'";

$result = mysql_query($query);

That will return only the reports of the given company id

Trevor (http://www.tkm-designs.com)