SQL statement/php [Closed]

-
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 

1 reply

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

Say "Thank you" 1

A few words of thanks would be greatly appreciated. Add comment

CCM 2415 users have said thank you to us this month

the sql in the server is correct but, in the web it still got an unidentified index
ac3mark
Posts
11990
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
April 23, 2019
2485 -
What credentials do the web server use to connect?