Copy link to clipboard
Copied
I have this little snippet that is supposed to cut off the search and return a message that too many records were located to continue, and to please refine the search:
<?php if ($totalRows_search = '>15') echo 'More than 15 records were located; please include more information in the search fields to reduce this list' ;die; ?>
It works fine when the search finds more than 15, but it also works when there are not that many records possible to find in the search; it pops up on every search. What am I doing wrong with this?
Thank you.
Brian
It should be this:
if ($totalRows_search > 15)
Copy link to clipboard
Copied
It should be this:
if ($totalRows_search > 15)
Copy link to clipboard
Copied
Thanks David. I could have sworn it worked originally with the quotes. That
fixed it.
I have a question regarding the code block you posted up before and before I
spend any more time trying to figure out how to adjust it to my needs, if I
tailor my questions tightly, could you take a look and tell me what
direction to go in? This is the code I'm talking about:
$expected = array(first_name, last_name, level, language, 'city', 'state',
'zip', );
$query_search = 'SELECT * FROM french;
$where = false;
foreach ($expected as $var) {
if (isset($_GET[$var]) && !empty($_GET[$var])) {
if ($where) {
$query_search .= ' AND ';
} else {
$query_search .= ' WHERE ';
$where = true;
}
$query_search .= $var . ' = '. GetSQLValueString($_GET[$var], 'text');
}
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more