Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39

Thread: Changing Data In MySQL Through PHP

  1. #31
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hiya ok I received a parse error I tried to see what it was but couldn't I'm probably going blind!

    PHP Code:
    mysql_query("UPDATE `tblmembers` SET `status`='$status' WHERE `userID`='$id'");

    header('Location: '.$_SERVER["PHP_SELF"]);
      }

      else { 

  2. #32
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by tomyknoker View Post
    Hiya ok I received a parse error I tried to see what it was but couldn't I'm probably going blind!

    PHP Code:
    mysql_query("UPDATE `tblmembers` SET `status`='$status' WHERE `userID`='$id'");

    header('Location: '.$_SERVER["PHP_SELF"]);
      }

      else { 
    What's the parse error?
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #33
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hiya a parse error I can't seem to find it ug!

    Parse error: parse error, expecting `']'' in e:\showMembers.php on line 94
    PHP Parse error: parse error, expecting `']'' in e:\showMembers.php on line 94

  4. #34
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    That has to do with this line:

    Code:
      elseif ($_REQUEST['act'] == "edit") {
     $id = $_REQUEST['id'];
     $status = $_REQUEST['status'];
    I forgot about the quote. Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #35
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ahhhhh great! For some reason the loginDateTime are all equal to 1-1-1970, I can understand that happening for users who haven't logged in yet but all the Approved users are equal to that... I added this line

    PHP Code:
    <?php echo date('d-m-Y'$q['loginDateTime']):'unknown';?>
    but this gives me the following error

    Parse error: parse error, expecting `','' or `';'' in e:\showMembers.php on line 179
    PHP Parse error: parse error, expecting `','' or `';'' in e:\showMembers.php on line 179

  6. #36
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    This:

    Code:
    <?php echo date('d-m-Y', $q['loginDateTime']):'unknown';?>
    makes no sense. Does your loginDateTime column (in your database) have the values as a unix timestamp (like 1175581024), or is it text (Jan 12, 2008)? If the first, then this should work:

    Code:
    <?php echo date('d-m-Y', $q['loginDateTime']);?>
    Otherwise, try using this:

    Code:
    <?php echo date('d-m-Y', strtotime($q['loginDateTime']));?>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #37
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hiya, in the database the fields look like this

    I added this code as I had this before, what it did was displayed the date/time a user had logged in and if they hadn't logged in since I added the loginDateTime column to the datatabase that field in the table was just populated with 'unknown'... But they are all unknown and looking into the datatbase I can see quite a few that have logged in

    PHP Code:
    <?php echo($qry['loginDateTime']?date('d/m/Y H:i:s'strtotime($qry['loginDateTime'])):'unknown'?>

  8. #38
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    What if you just do:
    Code:
    <?php echo $qry['loginDateTime'];?>
    See what it displays (if anything) and if you would like, go ahead and send me a screenshot. Not sure what else there is to say, but the code that is posted in one of my posts above should work.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  9. #39
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I sent you the screenshot, my very original page before all the sorting had that code too and it worked, It's wierd... Could it be to do with the sort feature?

Bookmarks

Posting Permissions

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