Hi there. I am trying to insert the following code into a text widget in Page Buider:
[insert_php] $servername = "localhost"; $username = "cobbcap"; $password = "AHO-zzpg?cO-"; $dbname = "cobbcap_wims"; $currentuser = "429600"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM Member WHERE CAPID = $currentuser"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "Welcome " . $row["Rank"]. " " . $row["NameFirst"]. " " . $row["NameLast"]. "!"; } } else { echo "0 results"; } $conn->close(); [/insert_php]
No matter what I do, it just displays the actual code, instead of actually running it.