It's a mistery:

when mysql say this lovely word

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in blabla.php on line xx

the easiest way to debug is to add "or die()"

But how many phpeople do this?

Check the poll...

    i don't die, i use exit()... 🙂

      well, do what you will, but it seems a lot better to do:
      die("EVIL HAS STRUCK!");
      than:
      echo "EVIL HAS STRUCK!";
      exit();
      but to each his own...............

        I prefer not to die, but after last night.,..

        Aaaoch!

          die("EVIL HAS STRUCK!");
          than:
          echo "EVIL HAS STRUCK!";
          exit();

          well, i use this..

          exit('Evil Has Struck');

          i think it is alias function.

            I prefer not to die, but after last night.,..

            what happened last night... ?

              Originally posted by jimson
              i think it is alias function.

              actually, checking the manual shows that die is an alias of exit -- but i'd still reather die than ........uh................o nvm.

                they should add as aliases:

                kickthebucket()
                harakiri()

                that sort of thing...
                then coding would be more fun 😃

                  I do use an or die... with a little difference...

                  or die("Error - webmaster informed" . mail( etc etc));

                  But saying that I have made a general function to handle most sql queries.. so all I need is

                  $query=do_query("SQL STATEMENT",$PHP_SELF);

                  The do_query bit does all the work... why should I write it all over and over again ??? If there is an error - I get the sql error, page number and time / date in an email - usually before the client calls me :-)

                  Nothing better than looking like you're on the ball...

                  Oh - and personally - I prefer to live !!

                    Jim:
                    Last night a collegue crashed his computer at home, and called me to come and have a look at it. Fixed the MBR in 5 minutes, and then we started on his wine.. Took a bit longer to fix/finish..

                      Well,
                      this poll say that usefull to put die() to debug the poor error.

                      but Now i think to make a new poll:

                      "It's die("EVIL HAS STRUCK!"); a clue for an easy debug ?" 😃

                      see you...

                        Fixed the MBR in 5 minutes

                        leatherback:
                        he he... if i am you, i will repartition the drive and format all partition. sounds like evil here... but maybe i will take more than 5 minutes... 🙁 system will take about 30 minutes to reinstall itself.. give him a XP box then usually, they don't call me afterthat.
                        this tip for u, if u receive many calls to ask you to see their MBR..

                        laser:

                        kickthebucket()
                        harakiri()

                        i like these, maybe should add them in php 4.3.3 😃
                        or maybe i should start using it now $harakiri = 'die';

                          Originally posted by laserlight
                          kickthebucket()
                          harakiri()

                          FYI Harakiri is concidered offensive. Please use the term sepuku for a death with honnor (and bring a bag for your head so your attendant doesn't have to carry it under his arm)

                          Actually you can easily recompile and add a few of your own 😃

                          such as :
                          buythefarm()
                          ginandcodeine()
                          ASP()

                          etc...

                            makes no difference here, just dying off is rather offensive too :p

                            actually, how does one spell "sepuku" transliterated?
                            I've also seen "seppuku"

                              from what I remember from my romaji course and my kanji courses (eek I was awake? you sure?) it has no tsu before pu so it's sepuku (but i have been wrong about japanese romaji spelling in the past. Yes it happens even to I)

                                Meh, I know it's cheating... but:

                                
                                function AnotherOneBitestheDust($s) {
                                
                                  die($s);
                                
                                }
                                

                                😉

                                  well, that doesnt emulate die() entirely, since die() in a language contruct and AnotherOneBitestheDust() is a function.

                                    Originally posted by laserlight
                                    kickthebucket()
                                    harakiri()

                                    function kickthebucket($params) {
                                      if (!isset($params)) {
                                        $params = "";
                                      }
                                      die($params);
                                    }
                                    function harakiri($params) {
                                      if (!isset($params)) {
                                        $params = "";
                                      }
                                      die($params);
                                    }
                                    

                                    I use die() on MySQL only, usually. ($result = mysql_query($query) or die(mysql_error());, for instance.)

                                      [st00pidn00bmode] Just curious, but why would you want to use the die command..As far as I can tell it only kicks in to supress an error? Then what's the use ? I presume everyone tries to write the code without errors like "Error on line blabla .... " so why use die? [/st00pidn00bmode]

                                        I'm not a god,
                                        and may be i forgive always some char, like ; or other.
                                        Or just make an concept error.

                                        When this do, i have to debug my application.


                                        Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in blabla.php on line xx

                                        just tell to me there is an error on mysql statement, but not any information of nature of this. right?

                                        Well, before post a message everywhere i think most speed ask to mysql directly.

                                        For me it's automathic use this:

                                        $result=mysql_query($query) or die ("Error 1:".mysql_error()."<br></b><i>".$query."</i>")

                                        Sometimes i write this when i write my page, other when i got an error...

                                        it's all.

                                        [EDIT]

                                        a simple search on this forum return to me 422 thread with this error !!!

                                        http://www.phpbuilder.com/board/search.php?s=&action=showresults&searchid=274882&sortby=lastpost&sortorder=descending