Answer the question
In order to leave comments, you need to log in
A friend says it's wrong. Is it right?
Is it right? A friend says it's wrong
$tabl = array('test' => '12');
$data = mysqli fetch assoc($query);
if( $data["$tabl[test]"] == '12' ) {
echo "good!";
} else { echo "bad!"; }
Answer the question
In order to leave comments, you need to log in
Judging by the fact that you cannot even lay out the source code here in a readable form, then all your other code is no better. No normal developer will undertake to support it - it will be much faster to write it in zero correctly than to figure out your if, include, etc.
Although the "select *" piece is hidden on the screen, I can bet that SQL is possible through the registration form in Nick injection. And through the browser, an outsider can merge all your data with one request, and delete your database with the second.
The first thing that catches your eye is how you work with array elements. Not only do you write the array keys not as strings, but as uninitialized constants, you also take the resulting value in quotes. What for?
In general, the question is very strange. It is necessary to give some explanation - what exactly in this code, for you or your friend, is wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question