Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    11

    Unanswered: Invalid resources but successful inserted record...?

    I successful to insert new record to my MySQL database server, but when I called the mysql_free_result, I got the error message which stated the $result was not valid resouces, what is the problem? Thanks.
    PHP Code:
    <?php

    $userName 
    $_POST['userName'];
    $userEmail $_POST['userEmail'];
    $password $_POST['RePassword'];

    $conn mysql_connect('localhost','Forumer','Forumer') or die("Can't Connect error EX001");
    $select mysql_select_db('Forumer');
    $query "Insert into Users (userName,userEmail,userPassword,userJoin) values ('$userName','$userEmail',sha1('$password'),'" .date('Y-n-j'). "')";
    $result mysql_query($query);
    mysql_free_result($result);
    mysql_close($conn); 

    ?>

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    An INSERT does not return a result set from the database, only a TRUE or FALSE is returned. There is no result set and no need to do a mysql_free_result(...) function call.

  3. #3
    Join Date
    Oct 2006
    Posts
    11
    Oh, I made such stupid mistake, thanks for helping..

Posting Permissions

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