Chapman Posted January 29, 2010 Report Share Posted January 29, 2010 (edited) <?php $link = mssql_connect($host, $username, $password); mssql_select_db('SecKeyPrior'); $nod_query = mssql_query('SELECT Id_Nod, Nod_Nos From S_Nod'); $users_querry = mssql_query('SELECT Id, F_Name, S_Name From S_Users'); ?> <html> <head> <script type="text/javascript"> function nod() { var no_list=document.getElementById("nod_list"); document.getElementById("adm_nod").value=nod_list.options[nod_list.selectedIndex].text; } </script> <script type="text/javascript"> function users() { var users_list=document.getElementById("users_list"); document.getElementById("adm_nod").value=users_list.options[users_list.selectedIndex].text; } </script> </head> <body> <center> <table class="In" border="1"> <tr> <td width="250" align="center"> <form> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td width="50"> Nodaļa: </td> <td> <select id="nod_list" onchange="nod()"> <?php while ($row = mssql_fetch_assoc($nod_query)) { ?> <option> <?php echo $row["Nod_Nos"];?> </option> <?php }?> </select> </td> </tr> <tr> <td> Vārds: </td> <td> <input type="text" id="adm_f_name" > </td> </tr> <tr> <td> Uzvārds: </td> <td> <input type="text" id="adm_l_name" > </td> </tr> </table> </td> <td align="center"> <table border="1" cellpadding="0" cellspacing="0"> <tr> <th width="200"> Lietotāji </th> <th width="200"> Lietoāji Online </th> </tr> <tr> <td> <select id="users_list" onchange="users()" size="4"> <option>viens123123</option> <option>divi</option> <option>tris</option> <option>cetri</option> <option>pieci</option> </select> </td> <td> <select size="4"> <option>viens123123</option> <option>divi</option> <option>tris</option> <option>cetri</option> <option>pieci</option> </select> </td> </tr> </table> </form> </td> </tr> liet tāda, ka tāpat kā nodaļas gribu attēlot lietotājus, bet problēmas sākas ar to, ka lietotāja vārds un uzvārds tiek glabāts DB atsevišķos laukos, bet man tos vajag attēlot kopā. Edited January 29, 2010 by Chapman Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted January 29, 2010 Report Share Posted January 29, 2010 kapec tu vnk nevari SELECT id(s) tabula1 LEFT JOIN tabula2 ON tabula1.id=tabula2.id ? Quote Link to comment Share on other sites More sharing options...
Chapman Posted January 29, 2010 Author Report Share Posted January 29, 2010 kapec tu vnk nevari SELECT id(s) tabula1 LEFT JOIN tabula2 ON tabula1.id=tabula2.id ? cik saprotu, shis ir domāts, ja ir atsevišķas tabulās, bet man Vards, Uzvards tiek glabadi viena tabula bet ka atsevišķi lauki! Quote Link to comment Share on other sites More sharing options...
Pentiums Posted January 29, 2010 Report Share Posted January 29, 2010 nesaprotu kur ir problēma vienkārši izvadīt to vārdu un uzvārdu? Quote Link to comment Share on other sites More sharing options...
Kemito Posted January 29, 2010 Report Share Posted January 29, 2010 Piekrītu Pentiums :/ Parastās lietas, kas jāizdara un viss :) Quote Link to comment Share on other sites More sharing options...
Chapman Posted January 29, 2010 Author Report Share Posted January 29, 2010 labi, to es pats uztaisiju: <?php $link = mssql_connect($host, $username, $password); mssql_select_db('SecKeyPrior'); $nod_query = mssql_query('SELECT Id_Nod, Nod_Nos From S_Nod'); $users_query = mssql_query('SELECT Id, F_Name, S_Name From S_Users'); $users_on_query = mssql_query('SELECT Id, F_Name, S_Name From S_Users Where'); ?> <html> <head> <script type="text/javascript"> function nod() { var no_list=document.getElementById("nod_list"); document.getElementById("adm_nod").value=nod_list.options[nod_list.selectedIndex].text; } </script> <script type="text/javascript"> function users() { var users_list=document.getElementById("users_list"); document.getElementById("adm_users_list").value=users_list.options[users_list.selectedIndex].text; } </script> </head> <body> <center> <table class="In" border="1"> <tr> <td width="250" align="center"> <form> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td width="50"> Nodaļa: </td> <td> <select id="nod_list" onchange="nod()"> <?php while ($row = mssql_fetch_assoc($nod_query)) { ?> <option> <?php echo $row["Nod_Nos"];?> </option> <?php }?> </select> <!--<p>N: <input type="text" id="adm_nod" size="20"></p>--> </td> </tr> <tr> <td> Vārds: </td> <td> <input type="text" id="adm_users_list" > </td> </tr> <tr> <td> Uzvārds: </td> <td> <input type="text" id="adm_l_name" > </td> </tr> </table> </td> <td align="center"> <table border="1" cellpadding="0" cellspacing="0"> <tr> <th width="200"> Lietotāji </th> <th width="200"> Lietoāji Online </th> </tr> <tr> <td> <select id="users_list" onchange="users()" size="4"> <?php while ($row = mssql_fetch_assoc($users_query)) { ?> <option> <?php echo $row["F_Name"].' '.$row["S_Name"]?> </option> <?php }?> </select> </td> problema rodas tur, ka es gribu vardu un uzvardu atseviskos input laukos attelot: Quote Link to comment Share on other sites More sharing options...
2easy Posted January 29, 2010 Report Share Posted January 29, 2010 problema rodas tur, ka es gribu vardu un uzvardu atseviskos input laukos attelot ja tu to sauc par problēmu, tad tev vēl nav bijušas īstas problēmas :D:D:D Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted January 29, 2010 Report Share Posted January 29, 2010 2esay - piekritu varetu uztaisit topiku kur visi ieraksta kadas ir vinuprat lielakas problemas kodejot bijusas - prakse Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 29, 2010 Report Share Posted January 29, 2010 Man ir zheel Ogres :( Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted January 29, 2010 Report Share Posted January 29, 2010 :/ tas galigi neiet si temata konteksta Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 29, 2010 Report Share Posted January 29, 2010 Daljeeji iet :) http://php.lv/f/topic/15295-input-submit-un-ieraksts-no-mssql-db Quote Link to comment Share on other sites More sharing options...
2easy Posted January 29, 2010 Report Share Posted January 29, 2010 haha, tas bija labs :D vsp man liekas, ka praksē vajag ņemt tos, kam jau ir pamatzināšanas, bet nav darba pieredzes. lai vismaz iegūst to Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.