Functions Php

// Make a MySQL Database called "db" with a table named "variables" with three rows ("id", "title", and "content"). Insert your data. Then call the page by going variables.php?id=1 etc.
$id = $_GET['id'];
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("db",$db);
$sql="SELECT * FROM variables WHERE id=" . $id;
$result=mysql_query($sql,$db);
$num = mysql_num_rows($result);
$cur = 1;
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$id = $row["id"];
$title = $row["title"];
$content = $row["content"];
echo "
  • Id = $id
    ";
    echo "Title of page = $title
    ";
    echo "Content = $content
  • ";
    $cur++;
    }
    ?>