pjwhitfield
Programmer
I have the following (Ive changed field names and table for ease of posting) very simple code:
$sql = "SELECT a,b,c,d FROM `tableA` WHERE a='Y' ORDER BY RAND()";
$result = mysqli_query(login(),$sql);
all works fine....however Ive decided to add a further bit of functionality so have added field 'e' to TableA and changed $sql to
$sql = "SELECT a,b,c,d,e FROM `tableA` WHERE a='Y' ORDER BY RAND()";
thats all Ive changed, simply asked it to return an additional field.
yet, on running I get the following error.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in......
If, however I replace the d with an e to "SELECT a,b,c,e..." or any of the other fields then all is fine, its only if I add field e, Ive tried adding it elsewhere in the statement eg "SELECT a,b,e,c,d..." but still the same. Its as if its set to only return 4 fields???
Strange one that no doubt has a simple answer but its losing me!
$sql = "SELECT a,b,c,d FROM `tableA` WHERE a='Y' ORDER BY RAND()";
$result = mysqli_query(login(),$sql);
all works fine....however Ive decided to add a further bit of functionality so have added field 'e' to TableA and changed $sql to
$sql = "SELECT a,b,c,d,e FROM `tableA` WHERE a='Y' ORDER BY RAND()";
thats all Ive changed, simply asked it to return an additional field.
yet, on running I get the following error.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in......
If, however I replace the d with an e to "SELECT a,b,c,e..." or any of the other fields then all is fine, its only if I add field e, Ive tried adding it elsewhere in the statement eg "SELECT a,b,e,c,d..." but still the same. Its as if its set to only return 4 fields???
Strange one that no doubt has a simple answer but its losing me!