1
Warning: mysql_num_rows() expects Parameter 1 to be Resource, Object Given in C: xampp htdocs associated.php on line 15
My php code
<?php
include"conectar.php";
// RECEBENDO OS DADOS PREENCHIDOS DO FORMULÃ?RIO !
// $funct = $_POST ["funct"]; //atribuição do campo "nome" vindo do formulário para variavel
$cpf = $_POST ["cpf"]; //atribuição do campo "cpf" vindo do formulário para variavel
$query="select cpf from teste where cpf = '" . $cpf . "'";
$stmt = mysqli_query( $con, $query);
if( $stmt === false) {
die( print_r( mysqli_error($con), true) );
}
else
{$rows = mysql_num_rows($stmt);
if ($rows === true) {
include('index.php');}
else
{include('dr-adesao.php');}
}
mysqli_close( $con );
?>
My connection is working!
I believe the error is in the file PHP!
Read Why should we not use mysql type functions_*?. Alter
$rows = mysql_num_rows($stmt);
for$rows = mysqli_num_rows($stmt);
– NoobSaibot
I made the change but even with Cpf already registered in the table, still sends me the page of table not affected!
– Flavio Cordas
Let’s take steps, the error has been fixed ? Remove the space on the line
$cpf = $_POST ["cpf"]
leaving so$cpf = $_POST["cpf"]
– NoobSaibot
yes I fixed it, but it sent me to .. I want to follow up on.php and since Cpf is already in the table, I should send it to index.php
– Flavio Cordas