Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

This snippet works partially...

Explorer ,
Sep 05, 2009 Sep 05, 2009

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

TOPICS
Server side applications
574
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 06, 2009 Sep 06, 2009

It should be this:

if ($totalRows_search > 15)

Translate
LEGEND ,
Sep 06, 2009 Sep 06, 2009

It should be this:

if ($totalRows_search > 15)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 06, 2009 Sep 06, 2009
LATEST

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');

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines