<?php $db_hostname = 'localhost'; $db_username = 'root'; $db_password = 'root'; $db_name = 'magazzino'; $db_tabella = 'utenti'; // 1) connessione al DB $link = mysql_connect($db_hostname ,$db_username, $db_password); $db_selected = mysql_select_db($db_name, $link); // 1b) costruzione della query $statement = "select id_utente, nome_utente, cognome_utente from ".$db_tabella; // 1c) esecuzione della query $result=mysql_query($statement,$link); // 1d) salvataggio dei dati in un array while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) $list[]=$row; ?> <!-- 2) costruzione del layout grafico --> <html> <body> <table border="1"> <tr> <td>id</td> <td>nome</td> <td>cognome</td> </tr> <? // 2b) visualizzazione dei dati dall'array suddetto all'interno del layout $cnt = count($list); for($t=0; $t<$cnt; $t++) { ?> <tr> <td><?=$list[$t]['id_utente']?></td> <td><?=$list[$t]['nome_utente']?></td> <td><?=$list[$t]['cognome_utente']?></td> </tr> <? } ?> </table> </body> </html>
<?php $db_hostname = 'localhost'; $db_username = 'root'; $db_password = 'root'; $db_name = 'magazzino'; $db_tabella = 'utenti'; // 1) connessione al DB $link = mysql_connect($db_hostname ,$db_username, $db_password); $db_selected = mysql_select_db($db_name, $link); // 1b) costruzione della query $statement = "select id_utente, nome_utente, cognome_utente from ".$db_tabella; // 1c) esecuzione della query $result=mysql_query($statement,$link); ?> <!-- 2) costruzione del layout grafico --> <html> <body> <table border="1"> <tr> <td>id</td> <td>nome</td> <td>cognome</td> </tr> <? // 2b) contestuale estrazione dei dati e loro visualizzazione all'interno del layout while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?> <tr> <td><?=$row['id_utente']?></td> <td><?=$row['nome_utente']?></td> <td><?=$row['cognome_utente']?></td> </tr> <? } ?> </table> </body> </html>
Monday, 25 November 2013
Thanks to everyone who helped us to discover and solve any problems, JiFile is no longer in Beta. Download ...
Monday, 25 November 2013
Friday, 08 November 2013
Tuesday, 01 October 2013
Monday, 26 August 2013
Friday, 28 June 2013
Friday, 31 May 2013
Monday, 13 May 2013