Query su tabella personale
-
Ho importato una mia tabella personale nel db di wordpress.`
Ora sto provando a recuperare i dati senza successoRicevo tale errore:
Errore sul database di WordPress: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘7991’ at line 1]Il file page.php
.... <?php is_page('statistiche'); include_once('inc/statistiche.php'); ?> ....
Il file statistiche.php
<?php global $wpdb; $table_name = "mytabella"; $sql=$wpdb->query("SELECT * FROM $table_name"); $result = $wpdb->get_results($sql); foreach ($result as $mt) { echo "<p>" . $mt->id. "</p>"; } ?>
Stai visualizzando 3 risposte - dal 1 al 3 (di 3 totali)
Stai visualizzando 3 risposte - dal 1 al 3 (di 3 totali)
- Il topic ‘Query su tabella personale’ è chiuso a nuove risposte.