SQL statement/php

Closed
no_one - 23 Mar 2018 à 15:25
 Blocked Profile - 23 Mar 2018 à 15:53
i got an unidentified index error in this line 6 and 7 please help

<?php if( ! defined( 'ACCESS' ) ) die( 'DIRECT ACCESS NOT ALLOWED' ); ?>
<?php

if( isset( $_POST ) ) {

$name = $_POST[ 'name' ];
$id = $_POST[ 'id' ];

if( $DB->query( "UPDATE products SET name='$name' WHERE id=$id" ) ) {
$MESSAGE = "Product successfully updated!";
$MESSAGE_TYPE = "info";
} else {
$MESSAGE = "Failed to update Product";
$MESSAGE_TYPE = "danger";
}

}

1 response

Blocked Profile
23 Mar 2018 à 15:28
Get onto the SQL server, and issue the same QUERY with the same login credentials to see if it errors out.
the sql in the server is correct but, in the web it still got an unidentified index
Blocked Profile
23 Mar 2018 à 15:53
What credentials do the web server use to connect?