i have this code:

<?php
session_start();
$id=$_SESSION['uid'];
include "dbconnect.php";
$query = "SELECT FROM members WHERE id='$id'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
?>

and it says mysql_fetch_array is not a valid argument.
help please

not a supplied mysql argument. sorry

Check line 5;
try this;
<?php
session_start();
$id=$_SESSION;
include("dbconnect.php");
$query = "SELECT * FROM members WHERE id='$id'";
$result = mysql_query($query);
if($result)
{
$row = mysql_fetch_array($result);
}
else
{
echo mysql_error();
}
?>
mysql_error(); will point out what the error is.
try it.

I think your query have any problem, mostly this error comes when error on your query or your database not have any record.. please check you query & related table.

Or try this..

$query = "SELECT FROM members WHERE id=".$id;

Maybe the problem is *. Try the sample query of olawale.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.