1. No Profile Picture
    Super Moderator
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2009
    Hartford, WI
    Rep Power

    Missing something in syntax?

    Howdy. I simply wish to run an INSERT. When this case is called, the page appears blank, even if I place an echo BEFORE this action. Below is my code, and to get the echo to display, I commented out my $statement... lines.

    PHP Code:
                              case "create":
    "INSERT INTO `rolodex` (CustomerID, FLName, Position, Number, Type, E-mail, Note) VALUES (" $_POST['companyID'] . ", '" $_POST['name'] . "', '" $_POST['position'] . "', '" $_POST['number'] . "', '" $_POST['type'] . "', '" $_POST['email'] . "', '" $_POST['note'] . "')";
    $statement $link->prepare("INSERT INTO `rolodex` (CustomerID, FLName, Position, Number, Type, E-mail, Note) VALUES (?, ?, ?, ?, ?, ?, ?)");
    $statement->bind_param('issssss'$_POST['companyID'], $_POST['name'], $_POST['position'], $_POST['number'], $_POST['type'], $_POST['email'], $_POST['note']);
    $companyID $_GET['id'];
    $var setVars();
    $submit "Edit";
    $formAction "?loc=rolodex&action=edit&id=" $companyID;
    And the echo offers:
    INSERT INTO `rolodex` (CustomerID, FLName, Position, Number, Type, E-mail, Note) VALUES (149, 'Triple Yep', 'Owners', '234-567-8900', 'Cell', 'xgjxjk@xdjgxj.com', 'Some note')
    Any help would be greatly appreciated. Thanks.

    Edit: Had to enclose the `E-Mail` field name in backticks.
    Last edited by ManiacDan; March 4th, 2013 at 08:18 AM.

IMN logo majestic logo threadwatch logo seochat tools logo