Back to top

Visualizza post

Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.


Post - danielemontesi

Pagine: [1]
1
Joomla! 3 / Re:problema tabella
« il: 17 Set 2013, 14:08:15 »
trovato l'errore..mancava la chiusura della tabella

2
Joomla! 3 / [RISOLTO] problema tabella
« il: 17 Set 2013, 13:08:19 »
Ciao a tutti..premetto che non sono esperto..ho realizzato una tabella in php utilizzando il plugin DirectPHP..funziona..perņ il footer del template viene posizionato sopra la tabella (vedi immagine)



Il codice č questo:

Codice: [Seleziona]
<?php
    
require_once JPATH_SITE.'/includes/php/user.php';
    require_once 
JPATH_SITE.'/includes/php/dbConnection.php';
    
    if (isset(
$_REQUEST["submit"])){

                
$selected $_REQUEST['ric'];
                    
                
$ricerca null;
                
$valore null;

                if (
$selected == 'cognome') {
                    
$ricerca "COGNOME";
                    
$valore $_REQUEST['cognome'];
                }
                else if (
$selected == 'nome') {
                    
$ricerca "NOME";
                    
$valore $_REQUEST['nome'];
                }
                
$tabella getUsername();

                
$sql_str "SELECT * FROM " $tabella " WHERE " $ricerca " LIKE '" $valore ."%'";
                
$query mysql_query($sql_str$conn) or die ("Errore nella query");

                if (
$riga mysql_fetch_array($query)){
                    
$query mysql_query($sql_str$conn) or die ("Errore nella query");
                    echo 
"<table width = 100% border = 1 cellpadding = 2 cellspacing = 2>";
                    echo 
"<tr>";
                    echo 
"<td></td>";
                    echo 
"<td>Cognome</td>";
                    echo 
"<td>Nome</td>";
                    echo 
"<td>Data di nascita</td>";
                    echo 
"</tr>";
                    
                    while (
$riga mysql_fetch_array($query)){
                        echo 
"<tr>";
                        echo 
"<td>";
                        echo 
"<a href='modifica.php?id=".$riga["IdIscritto"]."'>Modifica[/url]  ";
                        echo 
"<a href='elimina.php?id=".$riga["IdIscritto"]."'>Elimina[/url]  ";
                        echo 
"</td>";
                        echo 
"<td>" $riga['Cognome'] . "</td>";
                        echo 
"<td>" $riga['Nome'] . "</td>";
                        echo 
"<td>" $riga['DataNascita'] . "</td>";
                        echo 
"</tr>";
                    }
        }
        
mysql_close($conn);
    }
 
?>


Pagine: [1]


Web Design Bolzano Kreatif