while

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone

I am beginner

I have the following code:

 

<?

         $buscar = $_REQUEST['buscar'];

         $base = "inscripcion";

         $conexion = mysql_connect ( 'localhost' , 'root' , 'root' );

         mysql_select_db ( $base , $conexion );

         echo "<table border='1'>";

         $resultado = mysql_query ("select * from alumnos where Curso like
'$buscar'" , $conexion);

         while ( $registro = mysql_fetch_row ($resultado)) {

                   echo "<tr>";

                   foreach ( $registro as $clave ) {

                            echo "<td>" . $clave . "</td>";

                   }

         }

         echo "</tr></table>";

?>

<form action="buscar.php" method="post">

<input type="text" name="buscar"><br>

<input type="submit" value="BUSCAR">

</form>

 

I want to add a message when find results on the DB: ?Find n results?, when
don?t find results: ?0 results?.

How and where I must write the IF, and how I do for the n (number of
results) appear.

 

Thanks a lot!

Nice weekend!

 

 

+                                                                          _
   // Emiliano Boragina _

   // Diseño & Comunicación //////////////////
+                                                                          _

   // emiliano.boragina@xxxxxxxxx  /
   // 15 40 58 60 02 ///////////////////////////
+                                                                          _

 


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux