Getting data from the database depending on the value of the id in the URL.
$id= $_GET['id'];
$strSQL = "SELECT * FROM people WHERE id='$id'";
$rs = mysql_query($strSQL);
This is working, But it's displaying a blank page.
How can i fix this ?
解决方案
As I mentioned in my original comment:
"You need to use a loop in order to fetch the data, then echo it."
Others have given you examples and not to use your present method, here is a PDO method:
$mysql_hostname = 'xxx';
$mysql_username = 'xxx';
$mysql_password = 'xxx';
$mysql_dbname = 'xxx';
$id = $_GET['id'];
try {
$pdo= new PDO("mysql:host=$mysql_hostname;dbname=$mysql_dbname", $mys