[php] Erreur fatale : Types d'opérandes non supportés

Solved
Hello
On the following script, I get this error:
Fatal error: Unsupported operand types in ... online8
The script consists of retrieving the number present in the counter field in the visits table and adding one to it...

<?php mysql_connect("sql.free.fr","****","***"); mysql_select_db("codg82"); $requete="SELECT * from visites"; $result=mysql_query($requete); $compteur=mysql_fetch_array($result); $nombre=$compteur+1; $requete1="UPDATE visites SET compteur='$nombre' WHERE compteur='$compteur'"; $result1=mysql_query($requete1); echo "We have already had $nombre visitors on the telenote service"; mysql_close(); ?>


Thank you in advance
--
It's strange, we learn every day even when we don't keep ourselves informed!!!!
Configuration: motherboard asus k8n4e, processor: sempron 3300+, hard drive 80go memory: 512...

9 answers

  1. Hi

    Oh, that's weird...

    Maybe if your field "compteur" is of numeric type, try removing the quotes

    $requete1="UPDATE visites SET compteur=$nombre WHERE compteur=$compteur";


    but I hardly believe it...

    What is the exact type of your field "compteur"?

    --
    PhP  
    There are 10 types of people in the world: those who understand binary and the others...
    -3