1. Jezęli ktoś kliknie na button dodaje do mysql nową komórkę z wartsoscia usera (wiem jak z przema pobrać

2.Jeżeli w bazie mysql jest komórka z nazwą usera to wyświetl obrazek ,jak to najłatwiej zrobić?
class beer { var $posts; var $post_users; var $user_src; var $user_dst; var $users; var $config; var $lang; var $topic_first_post_id; var $show_sync_errors; var $topic_replies; function __construct() { $this->beer(); } function beer() { // asign mod configuration array $this->config['enabled'] = $board_config['beermod_enabled']; $this->config['forums'] = ( $board_config['beermod_forums'] ) ? explode(',', $board_config['beermod_forums']) : ''; $this->config['show_post_beers'] = $board_config['beermod_show_beers']; $this->config['unhide_bbcode_forums'] = ($board_config['beermod_unhide_forums']) ? $board_config['beermod_unhide_forums'] : ''; $this->config['sync_delay'] = $board_config['beermod_sync_delay']; // checking last synchronization if ( (time() - $board_config['beermod_last_sync']) > $board_config['beermod_sync_delay'] * 3600 && $board_config['beermod_sync_delay'] ) $this->synchronize(); $this->show_sync_errors = 1; } function synchronize() { // updating board configuration $sql = " update " . CONFIG_TABLE . " where config_name = 'beermod_last_sync'"; if ( !$db->sql_query($sql) && $this->show_sync_errors ) { message_die(GENERAL_ERROR, 'Synchronization error.', '', __LINE__, __FILE__, $sql); } // dumping configuration cache sql_cache('clear', 'board_config'); // getting not linked and fake entries $sql = " select b.beer_id, b.beer_src, b.beer_dst, p.post_id, p.poster_id, t.topic_id, f.forum_id, u1.user_id as user1, u2.user_id as user2 from " . BEER_TABLE . " b left join " . POSTS_TABLE . " p ON p.post_id = b.post_id left join " . TOPICS_TABLE . " t ON t.topic_id = b.topic_id left join " . FORUMS_TABLE . " f ON f.forum_id = b.forum_id left join " . USERS_TABLE . " u1 ON u1.user_id = b.beer_src left join " . USERS_TABLE . " u2 ON u2.user_id = b.beer_dst"; if ( !$db->sql_query($sql) && $this->show_sync_errors ) { message_die(GENERAL_ERROR, 'Synchronization error.', '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($results) ) { if ( !$row['post_id'] || !$row['topic_id'] || !$row['forum_id'] || !$row['user1'] || !$row['user2'] || $row['beer_src'] == $row['beer_dst'] || $row['beer_src'] == $row['poster_id'] ) $trash_beers[] = $row['beer_id']; } // dumping fake entries