0

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

5
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by lyrico
0

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.

0

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;

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.