Hi I am performing an SQL query (that only returns one row) and I am printing a particular column on screen just for test purposes. The problem I am having is, the column that I am printing contains a string of 12 characters (abcdef123456), yet sometimes the printed variable is empty.
So when I do var_dump($test);
sometimes I get:
string(12) "abcdef123456"
but some other times I get
string(12) ""
I dont understand why it knows there are 12 characters yet its still empty, and sometimes it says 12 characters yet its full. Due to this, I cant perform other functions as they rely on the string.
EDIT: here is the query
$query="SELECT * FROM members WHERE name='$member'";
$sqlResult=mysql_query($query);
$row = mysql_fetch_assoc($sqlResult);
$test = $row["membercode"];
var_dump($test);