0

Hi, i get an Error, but cant understand why i get this :S
The error is like this: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/techozin/public_html/multiligase/core/user.inc.php on line 31

The page codes:

user.inc.php

<?php
 
function fetch_users() {
        $result = mysql_query('SELECT `user_id` AS `id`, `user_name` AS `username` FROM `users`');
       
        $users = array();
       
        while (($row = mysql_fetch_assoc($result)) !== false) {
                $users[] = $row;
        }      
       
        return $users;
}

function fetch_user_info($uid) {
        $uid = (int)$uid;
       
        $sql = "SELECT
                                `user_name` AS `username`,
                                `user_firstname` AS `firstname`,
                                `user_lastname` AS `lastname`,
                                `user_email` AS `email`,
                                `user_about` AS `about`,
                                `user_location` AS `location`,
                                `user_gender` AS `gender`
                        FROM `users`
                        WHERE `user_id` = {$uid}";
                       
        $result = mysql_query($sql);
       
        return mysql_fetch_assoc($result);
}
?>

Plizz help :)

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.