Note that there are some explanatory texts on larger screens.

plurals
  1. POJoin 3 tables to display certain data PHP-MSSQL
    text
    copied!<p>so i have this 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> <p>1st table </p> <ul> <li>dbo.users</li> <li>pkey(UserID)</li> <li>EmployeeName</li> </ul> <p>2nd table </p> <ul> <li>dbo.PC</li> <li>pkey(PCID)</li> <li>PC_Number</li> </ul> <p>3rd table</p> <ul> <li>dbo.FA_PC</li> <li>pkey(FAID)</li> <li>fkey(UserID)</li> <li>fkey(PCID)</li> </ul> <p>how could i display the PC_Number of the currently selected $rs->Fields('UserID') in the same form and still be able to post it on printd.php</p> <p>i dont know how to connect the dbo.users->dbo.FA_PC->dbo.PC</p> <pre><code>&lt;form action="printd.php" method="post" target="_blank"&gt; &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='empt'&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>
 

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