SQL statement/php

-
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";
}

}
See more 

Your reply

1 reply

Best answer
Posts
10916
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
December 10, 2018
1
Thank you
Get onto the SQL server, and issue the same QUERY with the same login credentials to see if it errors out.

Thank you, ac3mark 1

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM has helped 2586 users this month

the sql in the server is correct but, in the web it still got an unidentified index
ac3mark
Posts
10916
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
December 10, 2018
-
What credentials do the web server use to connect?
Respond to ac3mark