LampPi

 

Code


MySQL: SELECT


...
$lp = new lamppi_class();
...

...
# Select lp_code
$SQL = "SELECT * FROM lp_code ";
$SQL .= "WHERE lp_code_id = '" . trim($codeRowID) . "'; ";
$result = $mysqli_link->query($SQL);

# Any errors?
if ($mysqli_link->error) {
# DB error
print("Database error: " . $mysqli_link->error);
}

# Set Code row
$row = mysqli_fetch_array($result);

# Free result set
$result->free();
...

...
# Set Code title
$myValue = $lp->get_array_value($row, "lp_code_title")
...


...
public function get_array_value($array, $array_key) {
# Initialization
$array_value = "";

# Is this set?
if (isset($array[$array_key])) {
$array_value = trim($array[$array_key]);
}else{
$array_value = "";
}

# Exit
return $array_value;
}
...


About

Contact

Links

Site Map

© LampPi 2018