I have another problem...
Thank you for the tip, but now I want to know why is the data being truncated the further you look into the array in the form:
Code: Select all
$query = $this->db_query("SELECT * FROM "$database.".".$table);
$query_array = $query->fetchAll();
$query->closeCursor();
foreach($query_fetch as $ka => $ta){
foreach($ta as $kb => $tb){
if($kb === $column){
echo "kb==".$kb." => tb==".$tb[$kb]."\n";
}
}
}
Why is $tb[$kb] is returning 1 character of the full data? For instance, I writing a function that will return the value of a column key indirectly by finding the value of another column key.
For instance, in a user table, you know there is only one user in that table, which stores the password and other information, so there shouldn't be any more then one username in that table.
The function I am writing finds the key that matches the $column variable which is the column key you are using to indirectly find the value of another key lets say, the UserID.
I mean the userID, you cannot find it directly unless you match your data indirectly.
But the problem with the code above, is not in the form of how it is finding the keys versus the values to match. The problem is on the fact that in the second of the foreach loop, the array values are all being truncated and you cannot finally match the value that you are using like the name of a particular user, because the value is truncated, else this form of getting the index userid of that particular user is not possible because of that problem...I never seen that type of problem of the values being truncated, any help please.
PHP is weird and dangerous, it loses your data.
Thanks.