Posted variables not coming across

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • The1corrupted
    New Member
    • Feb 2007
    • 134

    Posted variables not coming across

    Alright, so far, everything works fine and dandy until I hit a mysql snag... Three of my variables are not posting to the table successfully.

    [php]
    $otheruser=$_GE T['poster'];
    $time=date("H:i :s");
    $newchat="INSER T INTO `logs`(`who`, `towho`, `type`, `message`, `when`, `x`, `y`, `z`) VALUES ('$otheruser', '$towho', '$type', '$message', '$time', '$x', '$y', '$z')";
    $msg=$_GET['msg'];
    $mesgread=explo de(" ", $msg, 4);
    $explosion=expl ode(" ", $msg, 2);

    if ($mesgread[0]=="/" AND $user==$otherus er AND $mesgread[1]!="to") {
    $type="emote";
    $message=$explo sion[1];
    $towho="0";
    mysql_query($ne wchat);
    }
    [/php]
    When it hits the if statement, it refuses to work. The INSERT INTO works just fine for the who, x, y and z.
  • The1corrupted
    New Member
    • Feb 2007
    • 134

    #2
    Originally posted by The1corrupted
    Alright, so far, everything works fine and dandy until I hit a mysql snag... Three of my variables are not posting to the table successfully.

    [php]
    $otheruser=$_GE T['poster'];
    $time=date("H:i :s");
    $newchat="INSER T INTO `logs`(`who`, `towho`, `type`, `message`, `when`, `x`, `y`, `z`) VALUES ('$otheruser', '$towho', '$type', '$message', '$time', '$x', '$y', '$z')";
    $msg=$_GET['msg'];
    $mesgread=explo de(" ", $msg, 4);
    $explosion=expl ode(" ", $msg, 2);

    if ($mesgread[0]=="/" AND $user==$otherus er AND $mesgread[1]!="to") {
    $type="emote";
    $message=$explo sion[1];
    $towho="0";
    mysql_query($ne wchat);
    }
    [/php]
    When it hits the if statement, it refuses to work. The INSERT INTO works just fine for the who, x, y and z.
    Nevermind, I've fixed my error like so..
    [php]
    if ($mesgread[0]=="/" AND $user==$otherus er AND $mesgread[1]!="to") {
    $type=$mesgread[0];
    $message=$explo sion[1];
    $towho=NULL;
    $newchat="INSER T INTO `logs`(`who`, `towho`, `type`, `message`, `when`, `x`, `y`, `z`) VALUES ('$otheruser', '$towho', '$type', '$message', '$time', '$x', '$y', '$z')";
    mysql_query($ne wchat);
    }
    [/php]

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Originally posted by The1corrupted
      Alright, so far, everything works fine and dandy until I hit a mysql snag... Three of my variables are not posting to the table successfully.

      [php]
      $otheruser=$_GE T['poster'];
      $time=date("H:i :s");
      $newchat="INSER T INTO `logs`(`who`, `towho`, `type`, `message`, `when`, `x`, `y`, `z`) VALUES ('$otheruser', '$towho', '$type', '$message', '$time', '$x', '$y', '$z')";
      $msg=$_GET['msg'];
      $mesgread=explo de(" ", $msg, 4);
      $explosion=expl ode(" ", $msg, 2);

      if ($mesgread[0]=="/" AND $user==$otherus er AND $mesgread[1]!="to") {
      $type="emote";
      $message=$explo sion[1];
      $towho="0";
      mysql_query($ne wchat);
      }
      [/php]
      When it hits the if statement, it refuses to work. The INSERT INTO works just fine for the who, x, y and z.
      I don't have the faintest idea what you are talking about. The code you showed must be only a small part of the code you are referring to.

      But I am glad you solved it yourself.

      Ronald :cool:

      Comment

      • The1corrupted
        New Member
        • Feb 2007
        • 134

        #4
        Originally posted by ronverdonk
        I don't have the faintest idea what you are talking about. The code you showed must be only a small part of the code you are referring to.

        But I am glad you solved it yourself.

        Ronald :cool:
        If I posted the full code, then it would probably kill this page....

        Comment

        Working...