i'm very new in php mysql programming. i have write program for retrieving my users profile information, but showed me
mysql_fetch_assoc(): supplied argument is not a valid on line 9 and 21
here is my code. but on the other hand it's working on another database. i edited single quotes but it still give the same error message. can you please give me a solution or if you have like this program made by your own it will be more helpful to compare and identify my lacking's.
<?php
include ("config.php")
?>
<?php
function getUsersData($id)
{
$array=array();
$result = mysql_query("SELECT * FROM 'users' WHERE 'id' = '" . $id );
while($row = mysql_fetch_assoc($result))
{
$array['id']=$row ['id'];
$array['name']=$row ['name'];
$array['username']=$row ['username'];
$array['email']=$row ['email'];
}
return $array;
}
function getId($username)
{
$result = mysql_query("SELECT 'id' FROM 'users' WHERE 'username' = '" . $username . "'");
while($row = mysql_fetch_assoc($result))
{
return $row['id'];
}
}
?>