Note that there are some explanatory texts on larger screens.

plurals
  1. POdisplaying a data from database with 3 table joining together
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/14617873/join-3-tables-to-display-certain-data-php-mssql">Join 3 tables to display certain data PHP-MSSQL</a> </p> </blockquote> <p>I have these tables and I want to get certain datas for user to view and be able to POST to other page</p> <p>I cant post images so I have to break this down, so please bear with me</p> <pre><code>1st table - dbo.users - pkey(UserID) - EmployeeName 2nd table - dbo.PC - pkey(PCID) - PC_Number 3rd table - dbo.FA_PC - pkey(FAID) - fkey(UserID) - fkey(PCID) &lt;?php ini_set("display_errors","on"); $conn = new COM("ADODB.Connection"); try { $myServer = "WTCPHFILESRV\WTCPHINV"; $myUser = "sa"; $myPass = "P@ssw0rd"; $myDB = "wtcphitinventory"; $connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB; $conn-&gt;open($connStr); if (! $conn) { throw new Exception("Could not connect!"); } } catch (Exception $e) { echo "Error (File:): ".$e-&gt;getMessage()."&lt;br&gt;"; } if (!$conn) { exit("Connection Failed: " . $conn); } $sql_exp = "select * from dbo.users"; $rs = $conn-&gt;Execute($sql_exp); echo "&lt;select name='empf'&gt;"; while (!$rs-&gt;EOF) { set_time_limit(0); echo "&lt;option value=".$rs-&gt;Fields('UserID')." &gt;".$rs-&gt;Fields('EmployeeName')."&lt;/option&gt;"; $rs-&gt;MoveNext(); } $rs-&gt;Close(); ?&gt; </code></pre> <p>How could I display the <code>PC_Number</code> of the currently selected <code>$rs-&gt;Fields('UserID')</code> in the same form and still be able to post it on printd.php</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload