Jump to content

Search the Community

Showing results for tags 'userlist'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. //function that takes username and avatar function take_username_avatar() { try{ $results = array(); $query = mysql_query("SELECT username,avatar FROM data WHERE username!='{$_SESSION['username']}'")or die(mysql_error()); while($row = mysql_fetch_assoc($query)) { $results[] = $row; } return $results; } catch (Exception $e){ die("Error showing user list"); } } //page that shows user list $username_avatar = take_username_avatar(); foreach ($username_avatar as $user_avatar ) { ?> <p><a href='index.php?page=profile& username =<?php echo $user_avatar [' username ']; ?>'> <?php echo $kor_avatar[' username '] ?></a></p> <a href='index.php?page=profile&username=<?php echo $ user_avatar ['username']; ?>'> <img src="avatar/<?php echo $kor_avatar['avatar']; ?>" height='100' width='100' alt='avatar'></a> <?php } I have been trying to solve this for some time, even too long and I would really appreciate the help of experienced PHP user. I have made that user can see the list of the other members on the website but I also want to show error message if something goes wrong. I did it with try-catch block but I also been wondering if there is an efficient way to do that. I would also like to know how to make the error to happen because I need to make a print screen for documentation.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.