The mysql table record:
definitionID = 1,
term = alert('Hello World'); ,
definition = Javascript pop-up box
I am having some issues querying the definition field from the above example. Everything has already been through mysqli_real_escape_string as part of its form input method/validation.
The term is assigned to a variable earlier in my PHP. I think this worked fine.
//So, $term = alert('Hello World');
$definitionQuery="SELECT definition FROM definitionTable WHERE term='".$term."'";
$definitionArray = mysqli_query($dbc,$definitionQuery);
$row = mysqli_fetch_array($definitionArray);
$answer = $row['definition'];
/*In addition, document.getElementByID('test'); as a term doesn't work either
but the following do. Gotta be something to do with single quotes but cant
figure out what. Whilst the quotes are in a variable and not processed by PHP,
might they be processed in mysql?*/
<script></script> or,
document.getElementByID("DOUBLE");
The PHP error is:
mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given