multiple blank entries?

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

    #1

    multiple blank entries?

    Hello all, new problem...

    When I go to my secondary page of results after I fill info out on a form on
    the first, I get 3 blank entries automatically inserted into the mysql
    tables. This second form has these blank entries printing up each time even
    if I go in to the second page w/o filling out any info on the first. Is
    there a way I could prevent these blank entries from being automatically
    entered? Like some code that says that if something is blank then not to
    have it entered into the tables? or something easier?

    thanks in advance!


  • Pedro Graca

    #2
    Re: multiple blank entries?

    John wrote:[color=blue]
    > Like some code that says that if something is blank then not to
    > have it entered into the tables?[/color]

    Maybe the empty() function?
    Determine whether a variable is empty


    <?php
    if (!empty($someth ing)) {
    // do insert
    }
    ?>

    but ... beware ...

    <?php
    $something = '0';
    if (empty($somethi ng)) {
    echo 'something is empty!!!!';
    }
    ?>
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • John

      #3
      Re: multiple blank entries?

      "Pedro Graca" <hexkid@hotpop. com> wrote in message
      news:c2qkp6$215 ia5$1@ID-203069.news.uni-berlin.de...[color=blue]
      >
      > <?php
      > $something = '0';
      > if (empty($somethi ng)) {
      > echo 'something is empty!!!!';
      > }
      > ?>[/color]

      That would print 'something is empty!!!!' though right? I don't want
      anything to print.. like.. if it's blank then it just shouldn't print where
      as if there is something there it should print. For instance, say I have a
      name as a field.. if someone puts in their name, then it prints.. but for
      some reason the table inserts 3 records into itself for no apparent reason
      but when I print the record, I don't want those blank fields to print.

      Tho what would be easier.. is figuring out why it's inserting those 3 blank
      fields in itself in the first place :-)



      Comment

      Working...