3v4l.org

run code in 300+ PHP versions simultaneously
<?php $host_name = "db690172471.db.1and1.com"; $database = "db690172471"; $user_name = "dbo690172471"; $password = "JrJsmpXH5SM24Z4R"; $connect = mysqli_connect($host_name, $user_name, $password, $database); if ($connect) { // Stuff to do when connected to DB // Retrieves the username value from post $username=$_POST["email"]; $pwh=$_POST["pwh"]; // Checks to see if the username exists... $sql="SELECT email FROM Users WHERE email='$username'"; $sql=mysqli_real_escape_string($connect, $sql); $query = mysqli_query($connect,$sql); if (mysqli_num_rows($query) != 0) { // User already exists so check pw and set session varb to logged in echo "user exists"; } else { // Need to create user. echo "user $username does not exist"; // Adds the details to the db? $sql="INSERT INTO Users (email, password) VALUES ('$username', '$pwh');"; $sql=mysqli_real_escape_string($connect, $sql); $query2=mysqli_query($connect,$sql); if ($query2) { echo "New record created successfully"; } else { //echo "Error: " . $sql . "<br>" . $connect->error; echo "error" ; } } } else { // Stuff to do when not connected... echo "problemo"; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/c4rrs:7 Stack trace: #0 {main} thrown in /in/c4rrs on line 7
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:
37.25 ms | 401 KiB | 8 Q