cjosephson Posted July 24, 2007 Share Posted July 24, 2007 First off, does the use of $GLOBALS['var1'] mean that register_globals needs to be set to on? I'm not sure if $GLOBALS is part of register_globals, or if it is an alternative to it. The problem that sparks this question is this code: <?php // Build SQL Query $query = "select * from allsw where name like \"%$GLOBALS[trimmed]%\" order by name"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); echo "$numrows"; ?> <?php echo($GLOBALS['numrows']); ?> The first echo works perfectly, and spits out the correct number of results from the query. The second one, however, does not print anything out for some reason. The $GLOBALS[trimmed] works perfectly and returns valid results, but it is not working for $GLOBALS[numrows]. Thank you for any help. Link to comment https://forums.phpfreaks.com/topic/61588-php-globals/ Share on other sites More sharing options...
Germaris Posted July 24, 2007 Share Posted July 24, 2007 Sorry ! Wrong posting ! I deeply apologize. Link to comment https://forums.phpfreaks.com/topic/61588-php-globals/#findComment-306549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.