1
is the first value from the first row from your table.
Hint: Identity column.
Don't use *
in queries, you'll end up selecting more data than you'll want, which is slower.
If you want to get all the values, enumerate over $row
with a for loop.
You might also be interested in the end of the example here for a better approach:
// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
// then create $userid, $fullname, and $userstatus so you don't need $row.
while ($row = mysql_fetch_assoc($result)) {
echo $row["userid"];
echo $row["fullname"];
echo $row["userstatus"];
}
// Make sure that we be nice to our valuable memory.
mysql_free_result($result);
$row
with a for loop, so you get$row[1]
,$row[2]
and so on. You might also be interested in the end of the example here for a better approach. I've posted a whole answer below...mysql_fetch_assoc
together withextract($row)
, it makes it a lot easier. :)