3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Setup the connection to the database $con=mysqli_connect("mysql11.citynetwork.se","125966-hv96625","SidTheKidCrosby8778","125966-show-ratings"); $showID = get_the_ID(); // Fetch all available columns for the current show with the ID $showID $row = mysqli_fetch_array(mysqli_query($con,"SELECT * FROM `125966-show-ratings`.`ratings_for_shows` WHERE SHOW_ID=$showID")); $show_rating_link = ""; $show_rating_one_count = $row['one_vote']; $show_rating_two_count = $row['two_vote']; $show_rating_three_count = $row['three_vote']; $show_rating_four_count = $row['four_vote']; $show_rating_five_count = $row['five_vote']; $show_rating_six_count = $row['six_vote']; $show_rating_seven_count = $row['seven_vote']; $show_rating_eight_count = $row['eight_vote']; $show_rating_nine_count = $row['nine_vote']; $show_rating_ten_count = $row['ten_vote']; // Count the number of votes available in the database for all the fields $number_of_votes = $show_rating_one_count + $show_rating_two_count + $show_rating_three_count + $show_rating_four_count + $show_rating_five_count + $show_rating_six_count + $show_rating_seven_count + $show_rating_eight_count + $show_rating_nine_count + $show_rating_ten_count; // Count the sum of all the votes $sum_of_votes = 1 * $show_rating_one_count + 2 * $show_rating_two_count + 3 * $show_rating_three_count + 4 * $show_rating_four_count + 5 * $show_rating_five_count + 6 * $show_rating_six_count + 7 * $show_rating_seven_count + 8 * $show_rating_eight_count + 9 * $show_rating_nine_count + 10 * $show_rating_ten_count; // Count the max possible value $max_possible_sum = 10 * $number_of_votes; // Calculate the rating in percent with one decimal maximum $rating = round(($sum_of_votes / ($max_possible_sum) * 100) * 10) / 10;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/1QHjt:3 Stack trace: #0 {main} thrown in /in/1QHjt on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.3 ms | 401 KiB | 8 Q