Results 1 to 4 of 4

Thread: why does this not work

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    why does this not work

    PHP Code:
    <?php
    mysql_connect 
    (localhostuserpass);
    mysql_select_db (nz);
    ?>

    <?php
    if ($action == "save")
    {
    $result mysql_query ("UPDATE DB_Stats_Update Values ('$details')");
    ?>

    <p>


    <hr>


    <strong><font size="2">THANK YOU<br>
    </font>


    <?php
    } else {
    ?>

    <hr>
    <?php
    $result 
    mysql_query ("SELECT details from DB_Stats_Update");    
    $row mysql_fetch_array($result);
    $details $row["details"];
    ?>


    <hr>



    <form method="POST" action="index.php?action=save">
    <textarea rows="5" name="details" cols="34"><?php echo $details?>
    </textarea> 
    <br>
    <input type="submit" value="save" name="B1"></p>
    </form>

    <?php

    }


    ?></font>
    any ideas??
    Last edited by kiwis; May 9th, 2004 at 08:59 PM.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    what errors do you get?

    edit: your MySQL query where you're updating something is wrong.. it should be something like:
    Code:
    UPDATE table SET field='value' WHERE conditions='true'
    Like Archer? Check out some Sterling Archer quotes.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139
    Originally posted by kows
    what errors do you get?

    edit: your MySQL query where you're updating something is wrong.. it should be something like:
    Code:
    UPDATE table SET field='value' WHERE conditions='true'
    Ok I get it to display fine but not to update!! a text box does not use a "value"

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    from what you first posted, the new value you want to have is "$details".. you just have to specify what field you are updating, and change 'field' in my code to that.

    oh, and by the way, a textbox does have a value.. a textbox's value is whatever the user enters into it.
    Like Archer? Check out some Sterling Archer quotes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width