Menu

Search Error

2004-01-11
2013-04-09
  • Nobody/Anonymous

    When I try to search I get this:

    Database error in phpInv: Invalid SQL: SELECT prop.itemid,item.categorytitleid FROM phpinv_item AS item,phpinv_property AS prop WHERE property REGEXP "" AND item.itemid=prop.itemid AND categorytitleid='2' LIMIT 0,30
    mysql error: Got error 'empty (sub)expression' from regexp
    mysql error number: 1139
    Date: 10.01.2004 @ 20:52
    Script: /inv/search.php?keyword=Cisco&categoryid=2&hash=d79307f9b9702eafad2d8a5fc22ed26c&action=+Search+

     
    • Nobody/Anonymous

      You have no search criteria

       
    • Nobody/Anonymous

      I'm getting the same error.. a PHP version problem perhaps?

       
    • Nobody/Anonymous

      Has anyone been able to fix this, I have the same problem with php  4.3.4

       
    • Stefan Cyris

      Stefan Cyris - 2004-03-29

      I know :) It's because of an empty REGEXP. You have to search for
      something. An empty keyword gives this error.

       
    • Nobody/Anonymous

      Well, I figured out the problem. I did not have register_globals turn on in my php.ini . For some reason I thought that it had been recoded to not use it. Problem solved.

       
    • Nobody/Anonymous

      I get the same error, it definately isn't an empty querie as I know I typed something in. I tried to search for some data I know was there as there's only one record in the DB at present while I iron these things out.

      Help?

       
    • Nobody/Anonymous

      Further to that, I checked my php.ini and register_globals is set to "ON"......

      Any other ideas?

       
    • Secondshooter

      Secondshooter - 2005-12-17

      Add the following two lines to inc/variables.php

      isset($_GET['keyword']) ? $keyword = $_GET['keyword'] : $keyword = $_POST['keyword'];
      empty($_GET['keyword']) ? $keyword = '.' : $keyword = $keyword;

      This should solve the problem of the empty search and the register_globals being off. Hope everything is shiny

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.