when user clicks button shows datbase value with that id php

Solutions on MaxInterview for when user clicks button shows datbase value with that id php by the best coders in the world

showing results for - "when user clicks button shows datbase value with that id php"
Federica
15 Jun 2016
1<?Php
2require "config.php"; // database connection details 
3$str=$_GET['str']; // collect the student id
4
5$count=$dbo->prepare("select * from student where id=:id");
6$count->bindParam(":id",$str,PDO::PARAM_INT,3);
7
8if($count->execute()){
9$row = $count->fetch(PDO::FETCH_OBJ);
10echo "id: ".$row->id.", Name: ".$row->name." , Mark : ",$row->mark;
11}else{
12echo "Database Problem ";
13}
14
15?>
16