function display_articles_list() { $db_link = mysql_init(); if (!articles_already_parsed()) { parse_articles_list(); } $q = 'select * from t limit 10'; $r = mysql_query($q) or die("Query failed : " . mysql_error()); while ($row = mysql_fetch_assoc($r)) { echo "<a href='?id={$row['id']}'>{$row['title']}</a><br>"; } mysql_free_result($r); mysql_close($db_link); }
//=========================================================================== // Main body //=========================================================================== // Digits initialization - begin $digits_ini = @parse_ini_file($digits_config) or die("Cannot load Digits Configuration file!"); $digits_img = @imagecreatefrompng($digits_template) or die("Cannot Initialize new GD image stream!"); // Digits initialization - end $download_counter = 0; $upload_counter = 0; $rating_counter = 0; $img = @imagecreatefrompng($template_file) or die("Cannot Initialize new GD image stream!"); $userid = getParam(); if ($userid != "") { include $config_path; include $configlocal_path; mysql_init(); $query = "SELECT COUNT(id) FROM users WHERE id = '" . $userid . "'"; $result = @mysql_query($query) or die("Could not select data!"); $counter = mysql_result($result, 0); mysql_free_result($result); if ($counter > 0) { $query = "SELECT uploaded, downloaded FROM users WHERE id = " . $userid; $result = mysql_query($query) or die("Could not select data!"); while ($data = mysql_fetch_array($result)) { $upload_counter = $data['uploaded']; $download_counter = $data['downloaded']; if ($download_counter > 0) { $rating_counter = $upload_counter / $download_counter; } } }
function troc_mysql_prop() { $p = 'prop'; $r = troc_array_prop(); $ret = mysql_init($p, $r); return $ret; }