Goodafternoonguys,I'mtryingtofixasitethatIhaveaccesstobeforethecompanywasPostgreSQLnowI'mtryingtoupgradetomysqli,I'mstuckandI'dlikeyourhelp:
Youarehavingthefollowingerror:
PHPWarning:mysqli_stmt_bind_param():Numberofvariablesdoesnot matchnumberofparametersinpreparedstatementin
Igaveavar_dump,thiserrorappeared!!
ErronaComunicaçãocomoBancodeDados!object(mysqli_stmt)#2(10){["affected_rows"]=> int(0) ["insert_id"]=> int(0) ["num_rows"]=> int(0) ["param_count"]=> int(0) ["field_count"]=> int(7) ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["sqlstate"]=> string(5) "00000" ["id"]=> int(1) }
follow the code below:
contact_contents
<?php
/* Conexão com o BD */
include("../lib/connection.php");
$cod_contato = $_GET['contato'];
/* Constitui a string correspondente ao SQL */
$stmt = mysqli_stmt_init($connect);
if (mysqli_stmt_prepare ($stmt, 'SELECT id_contato, nome, assunto, ip_cad_contato, telefone, email, menssagem FROM contato WHERE WHERE id = $id'))
/* atribui os parametros aos marcadores */
mysqli_stmt_bind_param ($stmt, 'issssss', $cod_contato, $nome, $assunto, $ip, $telefone, $email, $menssagem);
/* executa a query */
mysqli_stmt_execute($stmt);
/* atribui as variaveis de resultado */
mysqli_stmt_bind_result ($stmt, $codigo, $nome, $assunto, $ip, $telefone, $email, $menssagem);
/* busca o valor */
mysqli_stmt_fetch($stmt);
/* fecha a declaração */
mysqli_stmt_close($stmt);
include ("tabela_contato.php");
/* Fehca a conexão com o BD */
mysqli_close($connect);
?>
below:
connection.php