matrikation Posted February 21, 2007 Share Posted February 21, 2007 hello i am using invision power board v 2.2.1 i want to add statues image for topic rates like this : so i already made this code below but it have error in line 15 so if anyone can help me to fix it <?php if ($_GET['id'] == "rating_tid") { header("content-type: image/png"); $db_host = "localhost"; $db_user = "root"; $db_pass = "654321"; $db_name = "1"; $db = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die ("Cannot connect to database"); $result = mysql_fetch_assoc("SELECT `rating_tid`, `rating_value` FROM ibf_topic_ratings") $rating = $result['rating_value']; $image = @imagecreatefrompng("rate.png"); $black = imagecolorallocate($image, 0, 0, 0); // Res $Img, rgb red, rgb green, rgb blue. Let's do white too. $white = imagecolorallocate($image, 255, 255, 255); @imagestring($image, 2, 185, 41, "Rating", $black); @imagestring($image, 1, 154, 55, $rating , $black); imagepng($image); // let's destroy it now. DIE! imagedestroy($image); // Finally, close mySql. mysql_close(); ?> Link to comment https://forums.phpfreaks.com/topic/39479-rate-topic-statues-image-code-help-me/ Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 $result = mysql_fetch_assoc("SELECT `rating_tid`, `rating_value` FROM ibf_topic_ratings") Please put a semicolon at the end of that line. If that doesn't work, make sure you identify what line 15 is. Link to comment https://forums.phpfreaks.com/topic/39479-rate-topic-statues-image-code-help-me/#findComment-190490 Share on other sites More sharing options...
matrikation Posted February 21, 2007 Author Share Posted February 21, 2007 this is line 15 $rating = $result['rating_value']; Link to comment https://forums.phpfreaks.com/topic/39479-rate-topic-statues-image-code-help-me/#findComment-190493 Share on other sites More sharing options...
tom100 Posted February 21, 2007 Share Posted February 21, 2007 Did you add the semicolon? Also, whats the error. Link to comment https://forums.phpfreaks.com/topic/39479-rate-topic-statues-image-code-help-me/#findComment-190516 Share on other sites More sharing options...
matrikation Posted February 21, 2007 Author Share Posted February 21, 2007 please put new code i don't know what u mean also take alook into this code <?php if ($_GET['id'] == "rating_tid") { header("content-type: image/png"); Link to comment https://forums.phpfreaks.com/topic/39479-rate-topic-statues-image-code-help-me/#findComment-190523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.