OK...I cannot figure this one out...I think the solution is php and not mySql so Here goes:
I have a sales leads DB that is accessed by my employees whom all have different levels of access (1-9).
The sales leads all come from one DB and the employee access level comes from another.
Every sales lead in the sales DB has been assigned to an employee. Ex:
leadID=3, is assigned to which_lo=4 as long as which_lo #4 has access level greater than 5.
lead_list_builder.php =
Creates a list of all leads that have been assigned to a particular employee that will link to a details page for that leadID Ex: SELECT leadID, which_lo FROM leads WHERE which_lo = 4;
That part is easy....My problem is on the details page.
lead_details.php=
I can very easily display the details for that lead by: SELECT name, address, etc... FROM leads WHERE leadID=3;
I want the details page to have a full recordset of all 57 leads assigned to that employee(which_lo=4) just like on the list builder page, except I want to be able to call a specific record(leadID=3) from within my 57 lead recordset: something like:
SELECT leadID, name, address etc...FROM leads WHERE which_lo=4;
This will return all 57 leads...
If I add "AND leadID=3" to the end of that, I only get ONE row in my recordset...
How do I get to leadID 3 from a recordset of 57?
The Macromedia recordset paging system for php is extremly close to what I want. I just want the added functionality of selecting a specific record from within the paging recordset.
Here is my recordset:
mysql_select_db($database_conn, $conn);
$query_rsLevel = "SELECT leads.name, etc... FROM leads WHERE which_lo=".$clientID;
$rsLevel = mysql_query($query_rsLevel, $conn) or die(mysql_error());
$row_rsLevel = mysql_fetch_assoc($rsLevel);
$totalRows_rsLevel = mysql_num_rows($rsLevel);
I have been accessing all of my fields like:
$row_rsLevel['name'];
I know the results are in the array but how can I move to row number 3 in this array?
Maybe like:
$leadID=$row_rsLeads['leadID'];
do{
blah...blah..
}while($leadID != 3)
I have NO IDEA !!!
Thanx in advance to whoever can tackle this one.
Gadnium