Jump to content
Larry Ullman's Book Forums

Recommended Posts

On line 33 it reads:

 

$words = FALSE; // Flag variable

 

- Why is this needed? Why false boolean?

 

 

On line 37 it reads:

 

$r = msyqli_query($dbc, $q);

 

if (mysqli_num_rows($r) == 1) {

 

$words = mysqli_fetch_array($r, MYSQLI_ASSOC);

 

}

 

- Is this common practice, to check to see if there is at least one result returned from the query? In some scripts, this is included and then in some it is. For example go to line 47 of the same script, when the array is fetched the function isn't wrapped in the same way as above.

 

 

Line 46, 47:

 

$r = msyqli_query($dbc, $q);

 

$r = mysqli_fetch_array($r, MYSQLI_ASSOC);

Link to comment
Share on other sites

 Share

×
×
  • Create New...