how can php get the user name
-
i want to get the esc_attr(um_user(‘display_name’)); to my new php for find the user data from sql this is my code
temp_test.php<?php $servername = "localhost"; $username = "root"; $password = "admin"; $dbname = "root"; $display_name = um_user('display_name'); //$divs = $html->find('a[title]'); // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT avgtemp FROM $display_name ORDER BY num DESC LIMIT 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row if($row = $result->fetch_assoc()) { echo $row["avgtemp"]; } } $conn->close(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how can php get the user name’ is closed to new replies.