Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $u = new UsersDAO("host=localhost port=5432 dbname=mydatabase user=naruse password=narusegawa");
- $tabla=$u->getAll("users");
- $i = 0;
- while ($line = pg_fetch_assoc($tabla)){
- $name = $line["name"];
- $age = $line["age"];
- if ($name == $_REQUEST["nombre"] && $age == $_REQUEST["age"] {
- $found = true;
- print_user($linea);
- break;
- }
- }
- if !($found)
- print "Algo, no lo encontre, blablablbla";
- pg_free_result($tabla);
- function print_user($user) {
- echo "<table>\n";
- echo "\t<tr>\n";
- foreach ($user as $field_val)
- echo "\t\t<td>$field_val</td>\n";
- echo "\t</tr>\n";
- echo "</table>"
- }
- ?>
Add Comment
Please, Sign In to add comment