Loading…

Instrument Details

[insert_php]

$id = intval($_GET[‘inst_id’]);

$connect = mysql_connect(“localhost”,”fmojhvmy_inst”,”P@55W0rd”); // connection location to the db or display error
$db = @mysql_select_db(“fmojhvmy_inst”,$connect); // connecting to the database or display error message

$result = mysql_query(“SELECT * FROM `instrument` WHERE `id` = ‘”.$id.”‘”);
if (!$result) { // add this check.
die(‘Invalid query: ‘ . mysql_error());
}

while ($row = mysql_fetch_array($result)) {
echo ‘

Go Back

‘;

echo ‘

‘.$row[‘hmmf_number’].’ – ‘ . get_proper_name($row[‘orientation’], “type”, “instrument_orientation”) . ‘ – ‘ . get_proper_name($row[‘key’], “type”, “instrument_key”).’ ‘ . get_proper_name($row[‘instrument_type’], “name”, “instrument_type”).’

‘;

echo ‘

‘.$row[‘description_short’].’

‘;
echo ‘

‘;

echo ‘

‘;

$sql1 = “SELECT * FROM `instrument_pictures` WHERE `instrument_id` = $id”;
$result1 = mysql_query($sql1);

while ($row_pic = mysql_fetch_array($result1)) {
echo ‘

‘;
}
echo ‘

     

Picture

 
'.$row['hmmf_number'].'
      ‘.$row[‘description_long’].’

‘;

echo ‘

Back

‘;
}

function get_proper_name($val, $fld, $tbl) {
$html = “”;
$result = mysql_query($sql = “SELECT $fld FROM $tbl WHERE `id` = ‘$val'”);
while ($row = mysql_fetch_array($result)) {
$html .= $row[$fld];
}
return $html;
}

[/insert_php]