Hi folks,
I don't know the meaning of those messages, I've tried lot of things, but in vain.
Notice: Use of undefined constant num_rows - assumed 'num_rows' in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 47
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 55
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 58
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 59So we don't have to refer to the attachment, here is the relevant portion of the file:
$sql = "select * from membre where id='$id'";
$result = mysql_query($sql) or die('query failed. ' . mysql_error());
$num_rows = mysql_num_rows($result);
//$requete=mysql_query($sql_bdd,"select * from membre where id=\"$id\"",$db_link) or die(mysql_error());
echo "$num_rows Rows\n";
// SI L'ID N'EXISTE PAS
if(num_rows != 0)
{
// REDIRECTION PAGE ERREUR
header("Location:$url_erreur");
exit;
}
// LIGNE FACULTATIVE : RECUPERATION DU PSEUDO
$pseudo_membre=mysql_result($result,0,"pseudo");
// CHAMPS SUPLEMENTAIRES
// Si vous avez ajout?des champs dans la table SQL, inspirez-vous de la ligne pré—ÂÂ忛枑ente pour ré—ÂÂå¼–pé—ÂÂç€ÂÂr leur valeur. Exemple :
$email=mysql_result($result,0,"email");
$ville=mysql_result($result,0,"ville");
The undefined constant notice is because you're missing a dollar sign in front of the '$num_rows' variable. And I'm guessing your other errors are because your result set is empty. Is that right? You should probably include some error handling for that.This the same post
Hi I don't know what to say an d what to do.
After solving a problem another one show up.
What's wrong with the code.
$sql = "select pseudo,passe, id from membre where pseudo='$pseudo_membre' and passe = '$passe_membre' and id = '$id'";
$result = mysql_query($sql) or die('query failed. ' . mysql_error());
$num_rows = mysql_num_rows($result);
//echo "$num_rows";
//$requete=mysql_query($sql_bdd,"select pseudo,passe from membre where pseudo=\"$pseudo_membre\" and passe=\"$passe_membre\"",$db_link) or die(mysql_error());
//$num_rows = mysql_num_rows($result);
//echo $num_rows;
// SI AUCUN ENREGISTREMENT NE CORRESPOND
if($num_rows > 0){
// SI LE LOGIN ET MOT DE PASSE SONT EXACTES
// CREATION D'UN IDENTIFIANT ALEATOIRE
$taille = 20;
$lettres = "abcdefghijklmnopqrstuvwxyz0123456789";
srand(time());
for ($i=0;$i<$taille;$i++)
{
$id.=substr($lettres,(rand()%(strlen($lettres))),1);
}
// MISE A JOUR DE L'IDENTIFIANT DANS LA TABLE
$query = "UPDATE membre
SET id = '$id'
WHERE pseudo = '$pseudo_membre' and passe='$passe_membre'";
mysql_query($query) or die('Error, modifying table membre failed : ' . mysql_error());
//$requete=mysql_query($sql_bdd,"update membre set id=\"$id\" where pseudo=\"$pseudo_membre\" and passe=\"$passe_membre\"",$db_link) or die(mysql_error());
// REDIRECTION VERS UNE PAGE PROTEGEE AVEC L'IDENTIFIANT SERVANT DE CLE
header("Location:zonemembre.php3?id=$id");
//header("location:$zone_membre");
}
else if($num_rows ==0){ echo "what is it?";
// REDIRECTION VERS LA PAGE ERREUR
//header("Location:$url_erreur");
//header('location: toi/erreur.htm');
//header('location: login.php3');
}
// DECONNEXION MYSQL
mysql_close($db_link);
when I try to print the row, it's always equal to zero. That means my select doesn't execute.
Please can s.o help me!Echo out your query to make sure the variables are set properly. If so, then try running the query directly in your database (phpMyAdmin or MySQL console). We'll go from there.
I don't know the meaning of those messages, I've tried lot of things, but in vain.
Notice: Use of undefined constant num_rows - assumed 'num_rows' in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 47
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 55
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 58
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\EasyPHP 2.0b1\www\database\espace_membre_v1.11\zonemembre.php3 on line 59So we don't have to refer to the attachment, here is the relevant portion of the file:
$sql = "select * from membre where id='$id'";
$result = mysql_query($sql) or die('query failed. ' . mysql_error());
$num_rows = mysql_num_rows($result);
//$requete=mysql_query($sql_bdd,"select * from membre where id=\"$id\"",$db_link) or die(mysql_error());
echo "$num_rows Rows\n";
// SI L'ID N'EXISTE PAS
if(num_rows != 0)
{
// REDIRECTION PAGE ERREUR
header("Location:$url_erreur");
exit;
}
// LIGNE FACULTATIVE : RECUPERATION DU PSEUDO
$pseudo_membre=mysql_result($result,0,"pseudo");
// CHAMPS SUPLEMENTAIRES
// Si vous avez ajout?des champs dans la table SQL, inspirez-vous de la ligne pré—ÂÂ忛枑ente pour ré—ÂÂå¼–pé—ÂÂç€ÂÂr leur valeur. Exemple :
$email=mysql_result($result,0,"email");
$ville=mysql_result($result,0,"ville");
The undefined constant notice is because you're missing a dollar sign in front of the '$num_rows' variable. And I'm guessing your other errors are because your result set is empty. Is that right? You should probably include some error handling for that.This the same post
Hi I don't know what to say an d what to do.
After solving a problem another one show up.
What's wrong with the code.
$sql = "select pseudo,passe, id from membre where pseudo='$pseudo_membre' and passe = '$passe_membre' and id = '$id'";
$result = mysql_query($sql) or die('query failed. ' . mysql_error());
$num_rows = mysql_num_rows($result);
//echo "$num_rows";
//$requete=mysql_query($sql_bdd,"select pseudo,passe from membre where pseudo=\"$pseudo_membre\" and passe=\"$passe_membre\"",$db_link) or die(mysql_error());
//$num_rows = mysql_num_rows($result);
//echo $num_rows;
// SI AUCUN ENREGISTREMENT NE CORRESPOND
if($num_rows > 0){
// SI LE LOGIN ET MOT DE PASSE SONT EXACTES
// CREATION D'UN IDENTIFIANT ALEATOIRE
$taille = 20;
$lettres = "abcdefghijklmnopqrstuvwxyz0123456789";
srand(time());
for ($i=0;$i<$taille;$i++)
{
$id.=substr($lettres,(rand()%(strlen($lettres))),1);
}
// MISE A JOUR DE L'IDENTIFIANT DANS LA TABLE
$query = "UPDATE membre
SET id = '$id'
WHERE pseudo = '$pseudo_membre' and passe='$passe_membre'";
mysql_query($query) or die('Error, modifying table membre failed : ' . mysql_error());
//$requete=mysql_query($sql_bdd,"update membre set id=\"$id\" where pseudo=\"$pseudo_membre\" and passe=\"$passe_membre\"",$db_link) or die(mysql_error());
// REDIRECTION VERS UNE PAGE PROTEGEE AVEC L'IDENTIFIANT SERVANT DE CLE
header("Location:zonemembre.php3?id=$id");
//header("location:$zone_membre");
}
else if($num_rows ==0){ echo "what is it?";
// REDIRECTION VERS LA PAGE ERREUR
//header("Location:$url_erreur");
//header('location: toi/erreur.htm');
//header('location: login.php3');
}
// DECONNEXION MYSQL
mysql_close($db_link);
when I try to print the row, it's always equal to zero. That means my select doesn't execute.
Please can s.o help me!Echo out your query to make sure the variables are set properly. If so, then try running the query directly in your database (phpMyAdmin or MySQL console). We'll go from there.