Combine them in SQL and loop through the dataset

select c.*, cd.*
from customers c
inner join customer_details cd on = cd.customer_id
[where clause as needed]

loop thru the recordset from that query just as you would with a query from
a single table and link the id to the edit  page

while ($rows = mysql_fetch_array($result))
    echo "<tr>";
    echo "<td>".$rows['id']."</td>";
    echo "<td>".$rows['name']."</td>";
    echo "<td><a href='edit_customer.php?id=".$rows['id']."</a></td>";
    echo "</tr>";

On Sat, Apr 25, 2015 at 4:34 AM Richard Quadling <>

> On 25 April 2015 at 06:13, Guru <> wrote:
> > Hi All,
> >
> > Hope everyone is doing well. I need some help regarding a project. I
> have a
> > huge list of customers in a ledger in a mysql table (Table A). And in
> > another table I have their names and their ID number (Table B). What I
> want
> > is when I click on a customer name from Table A,  I want php to pull out
> > the data of that particular customer  from Table B, and show it in a
> > formatted tabular manner. Please help me with this.
> >
> >
> Where to start. Well. What have you got at the moment?
> You will find it easier to get help if you offer what you've got at the
> moment.
> Are you using any framework or raw PHP?
> Regards,
> Richard.

Reply via email to