Dreamweaver recordset will not give me null

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kiqyou_vf

    #1

    Dreamweaver recordset will not give me null

    i know i know, wysiwyg's are not for loosers and all that but i've been
    coding php for about 6 months now and the one thing ive always wanted
    to do was see a live preview of my php so i can format tables without
    having to save and upload everytime- i figured out how to make
    dreamweaver do that! for the most part its pretty awesome (bulky/wierd
    php tho) but theres one thing that i JUST CANT FIGURE OUT- i have a
    recordset that will not return null from a querystring. when i feed the
    search results script an 'empty' variable (i just hit enter on the
    search form without typing in a query) it lists all of the entries
    instead of none of them. if anyone has ran into this situation before
    id really like to know what you did. its probably one stupid little
    setting that im being an idiot about, like it usually is, but i spent
    all night last night running through these groups and running through
    documentation. thanks a lot!

  • Andy Jacobs

    #2
    Re: Dreamweaver recordset will not give me null

    In article <1115580625.413 323.217400@z14g 2000cwz.googleg roups.com>,
    "kiqyou_vf" <sorensong@gmai l.com> wrote:
    [color=blue]
    > i know i know, wysiwyg's are not for loosers and all that but i've been
    > coding php for about 6 months now and the one thing ive always wanted
    > to do was see a live preview of my php so i can format tables without
    > having to save and upload everytime- i figured out how to make
    > dreamweaver do that! for the most part its pretty awesome (bulky/wierd
    > php tho) but theres one thing that i JUST CANT FIGURE OUT- i have a
    > recordset that will not return null from a querystring. when i feed the
    > search results script an 'empty' variable (i just hit enter on the
    > search form without typing in a query) it lists all of the entries
    > instead of none of them. if anyone has ran into this situation before
    > id really like to know what you did. its probably one stupid little
    > setting that im being an idiot about, like it usually is, but i spent
    > all night last night running through these groups and running through
    > documentation. thanks a lot!
    >[/color]

    Funny, just answered a post just like this is the dreamweaver group :o)

    As i said, can you post some code?

    --
    Andy Jacobs

    Intelligent Websites For Intelligent Business People

    Comment

    • kiqyou_vf

      #3
      Re: Dreamweaver recordset will not give me null

      really? cause i posted on the dreamweaver group too, but i didnt see a
      reply. iunno, maybe its a coincidence? :) anyway here is all the code
      that i THINK is relevant:

      $colname_search _results = "1";
      if (isset($_POST['key_words'])) {
      $colname_search _results = (get_magic_quot es_gpc()) ?
      $_POST['key_words'] : addslashes($_PO ST['key_words']);
      }
      mysql_select_db ($database_QCBD , $QCBD);
      $query_search_r esults = sprintf("SELECT * FROM qcbd WHERE key_words
      LIKE '%%%s%%' ORDER BY client_id ASC", $colname_search _results);
      $query_limit_se arch_results = sprintf("%s LIMIT %d, %d",
      $query_search_r esults, $startRow_searc h_results,
      $maxRows_search _results);
      $search_results = mysql_query($qu ery_limit_searc h_results, $QCBD) or
      die(mysql_error ());
      $row_search_res ults = mysql_fetch_ass oc($search_resu lts);


      again, i havent been coding for a long time so its hard for me to
      understand some of what dreamweaver is doing. im not clear on what the
      $colname_search _results does and i dont know what '%%%s%%' is. i know
      the % are wildcards, but when i did something like this before it was
      something like '%{$key_word}%' im not clear on what the 's' is, i dont
      see it defined anywhere. anyway, if this makes it anymore clear im
      dying to figure out what im doing wrong. thanks a lot!

      Comment

      • Geoff Berrow

        #4
        Re: Dreamweaver recordset will not give me null

        I noticed that Message-ID:
        <1115594658.281 075.129220@g14g 2000cwa.googleg roups.com> from kiqyou_vf
        contained the following:
        [color=blue]
        >$query_search_ results = sprintf("SELECT * FROM qcbd WHERE key_words
        >LIKE '%%%s%%' ORDER BY client_id ASC", $colname_search _results);[/color]

        The percentage char is a wild card. For instance %$myvar% would match
        $myvar with anything in front and anything after.

        If your $colname_search _results is empty you are saying where key words
        = anything so you get all records.

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • smilesinblues@gmail.com

          #5
          Re: Dreamweaver recordset will not give me null

          Hi,

          try this:

          $colname_search _results = "-1";

          Note the -ve sign.

          I hope this will help. as the problem you are talking about does not
          happen to me and I use -1.

          Thanks
          Bye

          Comment

          Working...