Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Update Record Db

  1. #1

    Update Record Db

    Ciao a tutti!
    Sono giorni che cerco ma non trovo...
    Volevo fare una pagina in PHP con un form con il quale posso modificare i record presenti nel mio database...
    Per esempio mi esce la lista delle mie news presenti nel database e di fianco i link Modifica e Elimina
    Come faccio?
    Grazie a tutti in anticipo

  2. #2
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    credo ti convenga dare un'occhiata a questa guida....
    http://php.html.it/guide/leggi/77/gu...mysql-pratica/

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  3. #3
    ho risolto scaricando questo script
    Codice PHP:
    <script language="php">

        
    include("dbconnect.php");
        global 
    $tableDefSet;
        global 
    $tableDefHgt;
        if(!isset(
    $tableDefSet)||$tableDefSet=="") { $tableDefSet ""; }        // Table selected by default in table list
        
    if(!isset($tableDefHgt)||$tableDefHgt=="") { $tableDefHgt "0"; }       // Height of table list: 0 = include all tables
        
    if(!isset($tableFilter)||$tableFilter=="") { $tableFilter ""; }        // Table name filter
        
    if(!isset($FilterToggle)||$FilterToggle=="") { $FilterToggle "show"; } // Show or Hide table names with filter string
    //    
    </script>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <title>Modifica News</title>
        <script language="JavaScript" type="text/javascript">
        function isNum (item)
        {    if (!areAllNumbers(item.value)) { alert('Only Numeric characters allowed.'); item.focus();} else { return true; } }
        function areAllNumbers (item)
        {    for (j=0; j<item.length; j++) { if (!isNumber (item.charAt (j))) {return false} } return true; }
        function isNumber (item)
        {    numeric = "0123456789-"; for (var i=0; i<numeric.length; i++) { if (item == numeric.charAt (i)) {return true} } return false }
        function returnconfirm(c)
        {    var comment=confirm(c); if (comment) return true; else return false; }
        </script>
        <style type="text/css">
        <!--
            BODY    { font-family: arial, verdana, helvetica, sans-serif; font-size: medium; color: White; }
            P        {    font-family: arial, verdana, helvetica, sans-serif; font-size: medium; color: White; }
            TD        {    font-family: arial, verdana, helvetica, sans-serif; font-size: small; color: White; }
            TD.N    {    font-family: arial, verdana, helvetica, sans-serif; font-size: small; color: White; }
            TD.G    {    font-family: arial, verdana, helvetica, sans-serif; font-size: small; color: White; }
            TD.S    {    font-family: arial, verdana, helvetica, sans-serif; font-size: small; color: White; }
            H1        {    font-family: arial, verdana, helvetica, sans-serif; font-size: large; color: White; font-weight : bold; margin-top : 0; margin-bottom : 0; margin : 0px 0px 0px 0px; }
            H2        {    font-family: arial, verdana, helvetica, sans-serif; font-size: small; color: White; font-weight : bold; margin-top : 0; margin-bottom : 0; margin : 0px 0px 0px 0px; }
            A            {    color: #0000FF; text-decoration: none; }
            A:visited    {    color: #3344FF; text-decoration: none; }
            A:hover        {    color: Red; ttext-decoration : underline; background-color:#E6E9FE; }
            SMALL.x        {    font-size : small; }
            SMALL.xg    {    font-size : small; color: White; }
            STRONG    {    font-size : x-small; color: White; }
        //-->
        </style>
    </head>
    <body>
        <table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr><td>
                <H1>Modifica Database</H1>
    <?PHP
        $readyFor 
    "3";        // 1=Edt, 3=Edt/Del, 7=Edt/Del/Cpy, 11=Edt/Del/Cpy/Add (11 not implemented yet)
        
    if (isset($_POST["GetTableName"]))
                {    
    $tableDef $_POST["GetTableName"];    }
        elseif (
    $tableDefSet != "")
                {    
    $tableDef $tableDefSet;    }
        else    {    
    $tableDef "";    }
        if (isset(
    $_POST["GetTableName"])) {
            echo 
    "</td><td><a href=\"".$_SERVER['PHP_SELF']."\">Pagina iniziale per modificare Record</a></td>";
        } else {
    $appdescription = <<<appdescription

    appdescription;
            echo 
    $appdescription "</td><td></td>";
        }
    ?>
            </tr><tr><td colspan="2"><hr color="Maroon" size="3"></td></tr>
        </table>
        <table width="700" border="0" cellspacing="0" cellpadding="3" align="center"><tr><td colspan="3">
    <?    if ((isset($_POST["GetTableName"]))&&($tableDef!=""))
        {    
    $tablename $tableDef;
            if (isset(
    $_POST["GetIt"]))
            {    if (
    $_POST["GetIt"]=="Modifica")
                {    
    $getDataQueryT "SELECT * FROM ".$tablename." ";
                    
    $getDataQueryT .= "WHERE `".$_POST["FieldUniqueName"]."`='".$_POST["FieldUniqueData"]."'";
                    
    $getDataQuery mysql_query($getDataQueryT) or die("Unable to get record. Please try again later.
    "
    .mysql_error());
                    
    $getFieldCount mysql_num_fields($getDataQuery);
                    echo 
    "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
                    echo 
    "<form name=\"PutItForm\" action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableName\" value=\"".$tablename."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListFieldCount\" value=\"".$_POST["GetTableListFieldCount"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListRecordS\" value=\"".$_POST["GetTableListRecordS"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListRecordT\" value=\"".$_POST["GetTableListRecordT"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"FieldUniqueName\" value=\"".$_POST["FieldUniqueName"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"FieldUniqueData\" value=\"".$_POST["FieldUniqueData"]."\">";
                    echo 
    "<tr><td colspan=\"2\" class=\"N\">Nome Tabella: [b]".$tablename."[/b] | Vai a: [b]<a href=\"#GetRecords\">Lista dei records</a> / <a href=\"#GetTableNames\">Lista Tabelle</a>[/b]
    <hr size=\"1\" color=\"Maroon\" noshade></td></tr>"
    ;
                    for (
    $icnt=0$icnt<$getFieldCount$icnt++)
                    {    
    $metaGet mysql_fetch_field($getDataQuery$icnt);
                        echo 
    "<tr><td>" mysql_field_name($getDataQuery$icnt);
                        if (
    $metaGet->primary_key == "1")
                        {    echo 
    "
    <small style=\"color:Maroon;\">Primary Key</small>"
    ;    }
                        echo 
    "</td><td>";
                        if (
    $metaGet->blob == "1")
                                {    echo 
    "<textarea name=\"".mysql_field_name($getDataQuery$icnt)."\" cols=\"64\" rows=\"2\">" mysql_result($getDataQuery,0,$icnt) . "</textarea></td>";    }
                        else    {    echo 
    "<input type=\"text\" name=\"".mysql_field_name($getDataQuery$icnt)."\" value=\"" str_replace("\"""&quot;"mysql_result($getDataQuery,0,$icnt)) . "\" size=\"85\" maxlength=\"".mysql_field_len($getDataQuery$icnt)."\"></td>";    }
                    }
                    echo 
    "<tr><td colspan=\"2\"><input type=\"submit\" value=\"Save\" name=\"PutIt\"></td></tr>";
                    echo 
    "</form></table>";
                    echo 
    "<hr size=\"3\" color=\"Navy\" noshade>";
                    
    mysql_free_result($getDataQuery);
                }
                elseif (
    $_POST["GetIt"]=="Cp")
                {    
    $getDataQueryT "SELECT * FROM ".$tablename." WHERE `".$_POST["FieldUniqueName"]."`='".$_POST["FieldUniqueData"]."'";
                    echo 
    "[b]gDQT:[/b] " $getDataQueryT "
    "
    ;
                    
    $getDataQueryQ mysql_query($getDataQueryT);
                    
    $getDataQueryT1 "";
                    
    $getDataQueryT2 "";

    //    $fields_names           = array();
    //    $fields_types           = array();
    //    while ($row = mysql_fetch_array($getDataQueryQ)) {
    //        $fields_names[]     = $row['Field'];
    //        // loic1: set or enum types: slashes single quotes inside options
    //        if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) {
    //            $tmp[2]         = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
    //            $fields_types[] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
    //        } else {
    //            $fields_types[] = $row['Type'];
    //        }
    //    } // end while

                    
    while ($row=mysql_fetch_array($getDataQueryQ))
                    {    
    $icnt=0;
                        while (
    $icnt mysql_num_fields($getDataQueryQ))
                        {    if ((
    strpos(mysql_field_flags($getDataQueryQ$icnt), "auto_increment")===false)) // Not a primary field
                            
    {
    $flagIt mysql_fetch_field($getDataQueryQ$icnt);
    if (!
    $flagIt) {    echo "Nessuna indormazione disponibile
    \n"
    ;    }
    else    {
    echo 
    "Field " $icnt " : ";
    if (
    $flagIt->name == 1) { echo "[b]".$flagIt->name."[/b]"; } else { echo $flagIt->name; } echo " / P:";
    if (
    $flagIt->primary_key == 1) { echo "[b]".$flagIt->primary_key."[/b]"; } else { echo $flagIt->primary_key; } echo " / U:";
    if (
    $flagIt->unique_key == 1) { echo "[b]".$flagIt->unique_key."[/b]"; } else { echo $flagIt->unique_key; } echo " / M:";
    if (
    $flagIt->multiple_key == 1) { echo "[b]".$flagIt->multiple_key."[/b]"; } else { echo $flagIt->multiple_key; } echo " / Max:";
    echo 
    $flagIt->max_length;
    echo 
    "
    "
    ;
    }
    // THIS IS AN OBJECT: MAY NEED TO DO WHILE LOOP TO DETERMINE IF unique_key IS AN ATTRIBUTE
                                
    $getDataQueryT1 .= mysql_field_name($getDataQueryQ$icnt).", ";
                                
    $getDataQueryT2 .= $row[$icnt]."', '";
                            }
                            else
                            {
    echo 
    "Field " $icnt " : ";
                                print(
    "[b]Primary:[/b] ".mysql_field_name($getDataQueryQ$icnt)."
    "
    );    }
                        
    $icnt++;
                        }
                    }
                    
    $getDataQueryT "INSERT INTO `".$tablename."` (".substr($getDataQueryT10strlen($getDataQueryT1)-2).") VALUES ('".substr($getDataQueryT20strlen($getDataQueryT2)-4)."');";
                    echo 
    "[b]gDQT:[/b] " $getDataQueryT "

    "
    ;
                
    //    $getDataQuery = mysql_query($getDataQueryT) or die("Unable to copy record. Please try again later.
    ".mysql_error());
                }
                elseif (
    $_POST["GetIt"]=="X")
                {    
    $getDataQueryT = "DELETE FROM ".$tablename." ";
                    
    $getDataQueryT .= "WHERE `".$_POST["FieldUniqueName"]."`='".$_POST["FieldUniqueData"]."'";
                    
    $getDataQuery = mysql_query($getDataQueryT) or die("Unable to delete recordPlease try again later.
    ".mysql_error());
                }
            }
            elseif (isset(
    $_POST["PutIt"]))
            {    
    $getDataQueryT = "SELECT FROM ".$tablename;
                
    $getDataQuery = mysql_query($getDataQueryT) or die("Impossibile ottenere un recordPer favore riprova
    ".mysql_error());
                
    $getFieldCount = mysql_num_fields($getDataQuery);
                
    $insertquery = "UPDATE ".$tablename." ";
                
    $insertquery .= "SET ";
                for (
    $icnt=0; $icnt<$getFieldCount$icnt++)
                {    
    $insertquery .= "`".mysql_field_name($getDataQuery$icnt)."` = ";
                    
    $insertquery .= "'".htmlspecialchars($_POST[mysql_field_name($getDataQuery, $icnt)])."'";    }
                    //
    $insertquery .= "'".addAslash($_POST[mysql_field_name($getDataQuery, $icnt)])."'";    }
                
    $insertquery = substr($insertquery, 0, strlen($insertquery)-2);
                
    $insertquery .= " WHERE `".$_POST["FieldUniqueName"]."`='".$_POST["FieldUniqueData"]."';";
                echo "
    [b]Query:[/b" . $insertquery . "

    ";
                mysql_query(
    $insertquery) or die ("Unable to save dataPlease try again later.".mysql_error());
                
    $goodtogo = "<font face='Arial' size='+1' color='Blue'><strong style=\"font-size:small;color:blue;\">";
                
    $goodtogo .= "Data has been saved - Thank you![/b]</font>";
                echo 
    $goodtogo "

    "
    ;
                
    mysql_free_result($getDataQuery);
            }
            if (
    $_POST["GetTableListRecordS"]=="" || $_POST["GetTableListRecordS"]=="0")
                    {    
    $GetTableListRecordS "0";    }
            else    {    
    $GetTableListRecordS = ((int)$_POST["GetTableListRecordS"])-1;    }
            if (
    $_POST["GetTableListRecordT"]=="" || $_POST["GetTableListRecordT"]=="0")
                    {    
    $getDataQueryNR mysql_query("SELECT * FROM ".$tablename) or die("Impossibile ottenere il record 1. Riprova più tardi.
    "
    .mysql_error());
                        
    $GetTableListRecordT mysql_num_rows($getDataQueryNR);
                        
    $GetTableListRecordTT $GetTableListRecordT;
                        
    mysql_free_result($getDataQueryNR);
                    }
            else    {    
    $getDataQueryNR mysql_query("SELECT * FROM ".$tablename) or die("Impossibile ottenere il record 1. Riprova più tardi.
    "
    .mysql_error());
                        
    $GetTableListRecordTT mysql_num_rows($getDataQueryNR);
                        
    mysql_free_result($getDataQueryNR);
                        
    $GetTableListRecordT $_POST["GetTableListRecordT"];
                    }
            
    $getDataQuery mysql_query("SELECT * FROM ".$tablename." LIMIT ".$GetTableListRecordS.",".$GetTableListRecordT) or die("Impossibile ottenere il record 2. Riprova più tardi.
    "
    .mysql_error());
            
    $getFieldCount mysql_num_fields($getDataQuery);

            if ((
    $_POST["GetTableListFieldCount"]>0)&&($_POST["GetTableListFieldCount"]<=99))
            {    if (
    $getFieldCount $_POST["GetTableListFieldCount"])
                        {    
    $getFieldCountShow $_POST["GetTableListFieldCount"];    }
                else    {    
    $getFieldCountShow $getFieldCount;    }
            }    else    {    
    $getFieldCountShow $getFieldCount;    }

            if (
    mysql_num_rows($getDataQuery)>0)
            {    if (isset(
    $_POST["tname"])) { echo "<input type=\"text\" name=\"tname\" value=\"".$_POST["tname"]."\">"; }
                echo 
    "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">";
                echo 
    "<tr><td colspan=\"".($getFieldCountShow+2)."\" class=\"N\">";
                echo 
    "<a name=\"GetRecords\"></a>Nome Tabella: [b]".$tablename."[/b] | ";
                echo 
    "Righe: [b]".$GetTableListRecordTT."[/b] | ";
                echo 
    "Totale dei campi: [b]".$getFieldCount."[/b] | ";
                if (
    $getFieldCountShow $getFieldCount)
                        {    echo 
    "<strong style=\"color:red;\">Campi mostrati: ".$getFieldCountShow."[/b] | ";    }

    </
    html>

  4. #4
    Codice PHP:
                else    {    echo "Campi che si stà mostrando: [b]".$getFieldCountShow."[/b] | ";    }
                echo 
    "Go To: [b]<a href=\"#GetTableNames\">Lista tabella</a>[/b]</td></tr>";
                
    $printTD "<td align=\"center\" valign=\"top\" class=\"G\">Row
    #</td>"
    ;    // prints all TDs that hold all the field names across the top
                
    $printTDp "";    // string to print Primary Key or No Primary Key defined
                
    $printTDq "0";    // if this changes, then a primary key has been found - else there is no primary key
                
    $printTD1 "<tr><td align=\"center\"></td>";    // this will change if no primary key is found
                
    $printTDh "";    // this will hold the field name if a primary key is found
                
    for ($icnt=0$icnt<$getFieldCount$icnt++)
                {    
    $meta mysql_fetch_field($getDataQuery$icnt);
                    if (
    $icnt<$getFieldCountShow)
                    {    if (
    $meta->primary_key == "1")
                                {    
    $printTDq "1";
                                    
    $printTDh $meta->name;
                                    
    $printTDp .= "
    <small style=\"color:Maroon;\">Chiave primaria</small>"
    ;    }
                        else     {    
    $printTDp "";    }
                        
    $printTD $printTD "<td valign=\"top\">[b]$meta->name[/b]".$printTDp"</td>";
                    } else {
                        if (
    $meta->primary_key == "1")
                                {    
    $printTDq "2";
                                    
    $printTDh $meta->name;    }
                    }
                }
                if (
    $printTDq == "0")
                    {    
    $printTD1 "<tr><td align=\"center\"><small style=\"color:Maroon;\">Nessuna 
    chiave definita</small></td>"
    ;    }
                elseif (
    $printTDq == "2")
                    {    
    $printTD1 "<tr><td align=\"center\"><small style=\"color:Maroon;\">Chiave primaria
     trovata fuori luogo</small></td>"
    ;    }
                echo 
    $printTD1 $printTD;
                echo 
    "</tr>";
                if (isset(
    $_POST["GetTableListRecordS"]) && ((int)$_POST["GetTableListRecordS"])>0)
                        {    
    $printTDcnt = (int)$_POST["GetTableListRecordS"];    }
                else    {    
    $printTDcnt 1;    }
                while(
    $row mysql_fetch_array($getDataQuery))
                {    echo 
    "<form name=\"GetItForm\" action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
                    echo 
    "<tr>";
                    if (
    $readyFor=="1")
                    {    echo 
    "<td align=\"center\"><input type=\"submit\" value=\"Modifica\" name=\"GetIt\"></td>";    }
                    elseif (
    $readyFor =="3")
                    {    echo 
    "<td align=\"center\"><input type=\"submit\" value=\"Modifica\" name=\"GetIt\"><input type=\"submit\" value=\"Cancella\" name=\"GetIt\" onClick=\"return returnconfirm('Cancellare?');\"></td>";    }
                    elseif (
    $readyFor == "7")
                    {    echo 
    "<td align=\"center\"><input type=\"submit\" value=\"Ed\" name=\"GetIt\"><input type=\"submit\" value=\"Cp\" name=\"GetIt\"><input type=\"submit\" value=\"X\" name=\"GetIt\" onClick=\"return returnconfirm('Delete?');\"></td>";    }
                    echo 
    "<td align=\"center\" class=\"G\">".$printTDcnt."</td>";
                    echo 
    "<input type=\"hidden\" name=\"GetTableName\" value=\"".$tablename."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListFieldCount\" value=\"".$_POST["GetTableListFieldCount"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListRecordS\" value=\"".$_POST["GetTableListRecordS"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"GetTableListRecordT\" value=\"".$_POST["GetTableListRecordT"]."\">";
                    echo 
    "<input type=\"hidden\" name=\"FieldUniqueName\" value=\"".$printTDh."\">";
                    for (
    $icnt=0$icnt<$getFieldCount$icnt++)
                    {    if (
    $icnt<$getFieldCountShow)
                        {    if (
    $row[$icnt] == "")
                            {    echo 
    "<td></td>";    } else
                            {    echo 
    "<td>" $row[$icnt] . "</td>";    }
                        }
                        if (
    mysql_field_name($getDataQuery$icnt) == $printTDh)
                        {    echo 
    "<input type=\"hidden\" name=\"FieldUniqueData\" value=\"".$row[$icnt]."\">";    }
                    }
                    echo 
    "</tr></form>";
                    
    $printTDcnt $printTDcnt 1;
                }
                echo 
    "</tr></table>";
                echo 
    "<hr size=\"3\" color=\"Navy\" noshade>";
            }
            else
            {    if (isset(
    $_POST["GetTableListRecordS"]) && ((int)$_POST["GetTableListRecordS"])>1)
                        {    echo 
    "

    Non ci sono record da mostrare in questa tabella ...
    Tuttavia, la riga di partenza potrebbe essere superiore al numero di record nella tabella...
    <hr size=\"3\" color=\"Navy\" noshade></P>"
    ;    }
                else    {    echo 
    "

    Non ci sono record da mostrare in questa tabella ...
    <hr size=\"3\" color=\"Navy\" noshade></P>"
    ;    }
            }
            
    mysql_free_result($getDataQuery);
        }
        if ((isset(
    $_POST["GetTableListSubmit"]))&&(empty($_POST["GetTableName"])))
        {    echo 
    "

    Scegliere un database!
    <hr size=\"3\" color=\"Navy\" noshade></P>"
    ;    }
        
    $getTableQuery mysql_list_tables($databasename$connectstring);
        if (
    $tableDefHgt=="0") { $getTableCount mysql_num_rows($getTableQuery)+1; }
            else { 
    $getTableCount $tableDefHgt; }
        if (
    mysql_num_rows($getTableQuery)>0)
        {    echo 
    "</td></tr><form name=\"GetTableForm\" action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
            echo 
    "<tr><td align=\"center\" valign=\"top\">";
            echo 
    "[b]Seleziona la tabella[/b]<a name=\"GetTableNames\"></a>
    "
    ;
            echo 
    "<select name=\"GetTableName\" id=\"GetTableName\" size=\"".$getTableCount."\" onClick=\"GetTableListSubmit.focus();\">";
            
    $gotIt "1";
            while(
    $tablerow mysql_fetch_array($getTableQuery))
            {    if (
            (
    $tableFilter=="") || 
            (
    $tableFilter!="" && $FilterToggle=="show" && stripos($tablerow[0],$tableFilter)!==FALSE) ||  // cont.- Show table names
            
    ($tableFilter!="" && $FilterToggle=="hide" && stripos($tablerow[0],$tableFilter)===FALSE)     // skip - Hide table names
            
    )
                {    if ((
    $tableDef!="")&&($tableDef==$tablerow[0]))
                            {    echo 
    "<option value=\"".$tablerow[0]."\" selected>".$tablerow[0]."</option>"$gotIt="2";    }
                    else    {    echo 
    "<option value=\"".$tablerow[0]."\">".$tablerow[0]."</option>";    }
                }
            }
            echo 
    "</select>";
            if ((
    $tableDefSet!="")&&($gotIt=="1")) { echo "
    <font color=\"Maroon\">Tabella</font> [ [b]
    $tableDefSet[/b] ]
    Modifica nel 'dbconnect.php'
    file <font color=\"Maroon\">inesistente</font>"
    ; }
            echo 
    "</td>";
            echo 
    "<td></td>";
            echo 
    "<td valign=\"top\">
    "
    ;
                echo 
    "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\"><tr>";
                    echo 
    "<td align=\"left\" valign=\"top\" colspan=\"2\">";
                    if (isset(
    $_POST["GetTableListFieldCount"]))
                            {    echo 
    "[b]Numero di campi[/b]
    (colonne) da mostrare
    <input type=\"text\" name=\"GetTableListFieldCount\" id=\"GetTableListFieldCount\" size=\"5\" value=\""
    .$_POST["GetTableListFieldCount"]."\" onblur=\"return isNum(this);\">";    }
                    else    {    echo 
    "[b]Numero di campi[/b]
    (colonne) da mostrare
    <input type=\"text\" name=\"GetTableListFieldCount\" id=\"GetTableListFieldCount\" size=\"5\" value=\"4\" onblur=\"return isNum(this);\">"
    ;    }
                    if (isset(
    $getFieldCount)) { echo "<strong style=\"color:silver;font-weight:normal;\">out of <strong style=\"color:silver;\">".$getFieldCount."[/b][/b]"; }
                    echo 
    "</td></tr>";
                    echo 
    "<tr><td align=\"left\" valign=\"top\">";
                    if (isset(
    $_POST["GetTableListRecordS"]) && $_POST["GetTableListRecordS"]!="")
                            {    echo 
    "[b]Partenza numero righe[/b]
    <input type=\"text\" name=\"GetTableListRecordS\" id=\"GetTableListRecordS\" size=\"5\" value=\""
    .$_POST["GetTableListRecordS"]."\" onblur=\"return isNum(this);\">";    }
                    else    {    echo 
    "[b]Partenza numero righe[/b]
    (empty, 0, 1: beginning)
    <input type=\"text\" name=\"GetTableListRecordS\" id=\"GetTableListRecordS\" size=\"5\" value=\"1\" onblur=\"return isNum(this);\">"
    ;    }
                    echo 
    "</td><td align=\"left\" valign=\"top\">";
                    if (isset(
    $_POST["GetTableListRecordT"]) && $_POST["GetTableListRecordT"]!="")
                            {    echo 
    "[b]Numero di righe[/b]
    da mostrare <input type=\"text\" name=\"GetTableListRecordT\" id=\"GetTableListRecordT\" size=\"5\" value=\""
    .$_POST["GetTableListRecordT"]."\" onblur=\"return isNum(this);\">";    }
                    else    {    echo 
    "[b]Numero di righe[/b]
    da mostrare (empty or 0: all remaining)
    <input type=\"text\" name=\"GetTableListRecordT\" id=\"GetTableListRecordT\" size=\"5\" value=\"0\" onblur=\"return isNum(this);\">"
    ;    }
                    echo 
    "</td>";
    $GetTableListFieldCountText = <<<GetTableListFieldCountText
                        <small class="x">
                        Se i record presenti nella tabella, la tabella risultante viene visualizzato sia il numero di campi, o tutti i campi della tabella, se inferiore. 


    Numero deve essere maggiore di 0 e minore o uguale a 99. Tutto il resto, come ad esempio 0, produrrà tutti i campi della tabella non importa quanti campi ci sono.
                        </small>
    GetTableListFieldCountText;
                    echo 
    "</tr><tr><td colspan=\"3\" align=\"left\" valign=\"top\">".$GetTableListFieldCountText;
                    echo 
    "

    <input type=\"submit\" name=\"GetTableListSubmit\" value=\"Mostra record\">"
    ;
                    echo 
    "</form>";
                    echo 
    "</td>";
                echo 
    "</tr></table>";
        }
        function 
    addAslash($str)
        { if (
    get_magic_quotes_gpc()==1)
            { return (
    $str); }
            else
            { return (
    addslashes($str)); }
        }
        
    mysql_free_result($getTableQuery);
    ?>
        </td></tr></table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
            <tr><td><hr color="Maroon" size="1"></td></tr>
            <tr><td align="right">
                <small class="xg">[url="http://facebook.com/ottyteo"]Matteo Ottella[/url]</small>
            </td></tr>
        </table>
    </body> 

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.