Is there a way to...

Status
Not open for further replies.

Baevus

the names ethan
Nov 4, 2012
565
47
This is what I want. I want to list all the usernames but it isn't working; Parse error: syntax error, unexpected T_STRING in /home/u523656928/public_html/Content/Scripts/membersmain.php on line 4. Is there a way to add a <?php tag in a <?php tag?

PHP:
<?php echo $_SESSION['id']?'Click on a members name to see their profile!<br/>
<?php include 'connect.php'
// Create connection
$conn = new sql($id, $username);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, username FROM Users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<br> id: ". $row["id"]. " - Username: ". $row["username"]. "<br>;
}
} else {
echo "There are no users registered!";
}
$conn->close(); ?>':'<i>If you are seeing this you are NOT logged in! Please do so by clicking Log In | Register!</i>';?>
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
I edited my post, you should really learn how to use PHP, then any problems you get try to self troubleshoot. Don't keep depending on other people to do it for you, otherwise you will be just like @Canadian.
 
Status
Not open for further replies.

Users who are viewing this thread

Top