I have a table in a database and my question is how can I create it … that when I type …/array.php?id=1 into the url, it will highlight that row. If I put id=2 in, then it will highlight row 2
[php]<?php
function connect(){
// Make a MySQL Connection
$link = mysqli_connect(“localhost”, “root”, “”, “school”) or die(mysqli_error());
return $link;
}
if ($_GET)
{
if(isset($_GET[“id”])) $id = $_GET[“id”];
}
// select query
$query = “SELECT * FROM graden” ;
if (isset($id)) { $query.= " WHERE id = $id "; }
$result = mysqli_query(connect(),$query);
// table making
$table = “
ID | Graden Celcius | Aanduiding | Image | $value | ";$value | ";
---|
echo $table;
?>[/php]