From: Ted Date: 2003-01-03T00:43:33+09:00 Subject: Re: Are we even getting close? Now we're getting somewhere! I was thinking that I'd need one for each condition, and that one rescue for the three conditions is the result of misched-up thinking. I've seen too many sloppy programs that did this sort of thing. But Ruby is different? Enquiring minds need to know... > Why do you need 3 blocks 'begin ... rescue' ? One is suffisant : the error > message will give you the reason of the failure > > This is not the same with php > > T> 3 $conn = mysql_connect('localhost','xxxxx','xxxxxxx'); > T> 4 if ($conn == FALSE) { > > here you must test the result of mysql_connect > > T> 5 echo 'Connection failed: '.mysql_error($conn); > T> 6 } else { > T> 7 mysql_select_db('mysql', $conn); > T> 8 $query = "select host, user, password from user"; > T> 9 $res = mysql_query($query, $conn); > T> 10 if ($res == NULL) { > > here you must test the result of mysql_query > > > > Guy Decoux >