Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
G

geysermill

@geysermill
Non seguire Segui
Informazioni
Post
3
Discussioni
1
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Post

Recenti Migliore Controverso

  • Problema update database
    G geysermill
    Coding

    Ciao Flavio,
    ho inserito il codice da te suggerito dopo "$msg = 'Aggiornata correttamente!';" e mi stampa: bool(false).
    Inoltre nel file error_log ho questo errore:
    PHP Warning: PDOStatement::execute() expects parameter 1 to be array, string given in /home/uqplaxvd/public_html/crm2020/update.php on line 18

    Inserendo solo "$pdo->errorInfo();" dopo "$msg = 'Aggiornata correttamente!';" mi da questo errore nel file error_log:
    PHP Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /home/uqplaxvd/public_html/crm2020/update.php on line 16

    Ho eliminato "ID = ?"
    Grazie per il supporto.


  • Problema update database
    G geysermill
    Coding

    Grazie.

    • <?php
    • include 'functions.php';
    • $pdo = pdo_connect_mysql();
    • $msg = '';
    • // Check if the commessa ID exists, for example update.php?ID=1 will get the commessa with the ID of 1
    • if (isset($_GET['ID'])) {
    • if (!empty($_POST)) {
    • // This part is similar to the create.php, but instead we update a record and not insert
    • $id = isset($_POST['ID']) ? $_POST['ID'] : NULL;
    • $data = isset($_POST['data']) ? $_POST['data'] : date('Y-m-d');
    • $clienti = isset($_POST['clienti']) ? $_POST['clienti'] : '';
    • $descrizione = isset($_POST['descrizione']) ? $_POST['descrizione'] : '';
    • $quantita = isset($_POST['quantita']) ? $_POST['quantita'] : '';
    • // Update the record
    • $stmt = $pdo->prepare('UPDATE commesse_2020 SET ID = ?, data = ?, clienti = ?, descrizione = ?, quantita = ?, WHERE ID = ?');
    • $stmt->execute([$id, $data, $clienti, $descrizione, $quantita, $_GET['ID']]);
    • $msg = 'Aggiornata correttamente!';
    • }
    • // Get the commessa from the commesse table
    • $stmt = $pdo->prepare('SELECT * FROM commesse_2020 WHERE ID = ?');
    • $stmt->execute([$_GET['ID']]);
    • $commessa = $stmt->fetch(PDO::FETCH_ASSOC);
    • if (!$commessa) {
    • exit('La commessa non esiste con questo ID!');
    • }
    • } else {
    • exit('No ID specified!');
    • }
    • ?>
    • <?=template_header('Read')?>
    • <div class="content update">
    • <h2>Modifica commessa #<?=$commessa['ID']?></h2>
    • <form action="update.php?ID=<?=$commessa['ID']?>" method="post">
    • <label for="ID">ID</label>
    • <input type="text" name="ID" placeholder="26" value="auto" ID="ID">
    • <label for="data">data</label>
    • <input type="datetime-local" name="data" value="<?=date('Y-m-d')?>" ID="data">
    • <label for="clienti">clienti</label>
    • <input type="text" name="clienti" placeholder="Nome cliente" ID="clienti">
    • <label for="descrizione">descrizione</label>
    • <input type="text" name="descrizione" placeholder="Descrizione" ID="descrizione">
    • <label for="quantita">quantita</label>
    • <input type="text" name="quantita" placeholder="Quantita" ID="quantita">
    • <input type="submit" value="Update">
    • </form>
    • <?php if ($msg): ?>
    • <p><?=$msg?></p>
    • <?php endif; ?>
    • </div>
    • <?=template_footer()?>

  • Problema update database
    G geysermill
    Coding

    Buongiorno,
    sono alle prime armi con php e sto impostando un semplice CRUD.
    Ho un problema con il file update che non mi fa aggiornare i dati del database. Non si genera nessun error_log e quando modifico i dati nel browser, il sistema mi dice che sono aggiornati correttamente ma non vengono modificati. Tutto il resto funziona. Riuscite a darmi un aiuto per favore? Di seguito il codice.
    Grazie. Francesco.

    <?phpinclude 'functions.php';$pdo = pdo_connect_mysql();$msg = '';// Check if the commessa ID exists, for example update.php?ID=1 will get the commessa with the ID of 1if (isset($_GET['ID'])) {    if (!empty($_POST)) {        // This part is similar to the create.php, but instead we update a record and not insert        $id = isset($_POST['ID']) ? $_POST['ID'] : NULL;        $data = isset($_POST['data']) ? $_POST['data'] : date('Y-m-d');        $clienti = isset($_POST['clienti']) ? $_POST['clienti'] : '';        $descrizione = isset($_POST['descrizione']) ? $_POST['descrizione'] : '';        $quantita = isset($_POST['quantita']) ? $_POST['quantita'] : '';        // Update the record        $stmt = $pdo->prepare('UPDATE commesse_2020 SET ID = ?, data = ?, clienti = ?, descrizione = ?, quantita = ?, WHERE ID = ?');        $stmt->execute([$id, $data, $clienti, $descrizione, $quantita, $_GET['ID']]);        $msg = 'Aggiornata correttamente!';    }    // Get the commessa from the commesse table    $stmt = $pdo->prepare('SELECT * FROM commesse_2020 WHERE ID = ?');    $stmt->execute([$_GET['ID']]);    $commessa = $stmt->fetch(PDO::FETCH_ASSOC);    if (!$commessa) {        exit('La commessa non esiste con questo ID!');    }} else {    exit('No ID specified!');}?>
    <?=template_header('Read')?>
    <div class="content update">	<h2>Modifica commessa #<?=$commessa['ID']?></h2>    <form action="update.php?ID=<?=$commessa['ID']?>" method="post">      <label for="ID">ID</label>      <input type="text" name="ID" placeholder="26" value="auto" ID="ID">      <label for="data">data</label>      <input type="datetime-local" name="data" value="<?=date('Y-m-d')?>" ID="data">      <label for="clienti">clienti</label>      <input type="text" name="clienti" placeholder="Nome cliente" ID="clienti">      <label for="descrizione">descrizione</label>      <input type="text" name="descrizione" placeholder="Descrizione" ID="descrizione">      <label for="quantita">quantita</label>      <input type="text" name="quantita" placeholder="Quantita" ID="quantita">        <input type="submit" value="Update">    </form>    <?php if ($msg): ?>    <p><?=$msg?></p>    <?php endif; ?></div>
    <?=template_footer()?>
    
  • Accedi

  • Non hai un account? Registrati

  • Accedi o registrati per effettuare la ricerca.
  • Primo post
    Ultimo post
Home Accedi Registrati
Menu
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.