问题描述:

I have 2 tables in my DB.

First is called birou and has:

id name desk (3 columns)

The second one is called flux_receptie and has:

id motiv nume_client reg_date status_solutionare status_preluare

ora_preluare ora_rezolvare operator_preluare operator_solutionare (10 columns)

  1. -desk- column is the desk where an user works. He selects on which desk he is working in each day from his account. (This mean I use sessions).
  2. -operator_preluare- is the user account.
  3. -nume_client- is the name of the client which comes in the office (he introduces his name personally in the database through an input page php).

I need an echo which has to show: the client ID, nume_client and the desk value (assigned by the user to itself).

My code so far is working but I need to add desk value from the birou:

$rst=mysql_query("select * from flux_receptie where status_preluare ='PRELUAT' order by ora_preluare desc limit 3",$link);

while($res = mysql_fetch_array($rst))

if(($res)==TRUE)

echo "<br /><center>

<table border='1' class='fixed'>

<td><center>$res[0]</center></td><br /><br /><br /><br />

<td><center>$res[2]</center></td><br /><br /><br /><br />

<td><center>&#10148; BIROUL **VALUE DESK HERE**</center></td>

</center>";

?>

I hope you understood what I am trying to say here. I need to combine the 2 tables in order to show 3 simple values (2 Already are shown, but I need the desk value).

Can anyone please help me? I googled but I did not really understood how to combine them. Thank you very much!

相关阅读:
Top