Posts by Susi • 85 points
4 posts
-
3
votes3
answers56
viewsQ: Use prepare statement at a constant value?
$type = 'post'; $stmtPG = $conn->prepare("SELECT count(*) FROM myTable WHERE entry_type = :type"); $stmtPG->bindParam(':type', $type); $stmtPG->execute(); $total =…
-
1
votes2
answers52
viewsQ: How to place variable concatenated inside a <a>?
I have this php line: echo '<a href="?p=ultimasnoticias&pagina='.$i.'">'.$i.'</a>'; I need to put the .$i. between the <a>.$i.</a> in my html script, example: <nav>…
-
1
votes1
answer39
viewsQ: Paging system not working - SERVER SIDE
This is my file called index.php: <?php $maxlinks = 4; $paginaAtual = (isset($_GET['paginaAtual'])) ? (int)$_GET['paginaAtual'] : 1; $maximo = 5; $inicio = (($maximo * $paginaAtual) - $maximo);…
-
-2
votes1
answer155
viewsQ: Why is my foreach duplicating my database records?
function DBRead($table, $params = null, $fields = '*'){ $table = DB_PREFIX.'_'.$table; $params = ($params) ? " {$params}" : null; $query = "SELECT {$fields} FROM {$table}{$params}"; $result =…