I have an options table setup like so:
option_id option_name option_value
1 sitetitle SimpleCollab
2 siteurl http://example.com/
3 sitepath /home/user/MAMP/htdocs/pm
4 enable_registration 1
5 enable_query 1
Then my php code is as follows:
function get_pm_option( $option ) {
global $pmdb;
$result = $pmdb->query( "SELECT * FROM " . DB . "options WHERE option_name IN ('$option')" );
while($r = $result->fetch_object()) {
return $r->$option;
}
}
Then my html is like so:
<tr><td>Site Title:</td> <td><input class="forminput" name="sitetitle" size="40" value="<?php echo get_pm_option('sitetitle'); ?>" maxlength="255"></td></tr>
Can you see what might be wrong with any of my code above? The site title is not being printed from the database.