SQL statement/php

no_one - Mar 23, 2018 at 03:25 PM - Latest reply: ac3mark 10759 Posts Monday June 3, 2013Registration dateModeratorStatus November 2, 2018 Last seen
- Mar 23, 2018 at 03:53 PM
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

3 replies

Best answer
ac3mark 10759 Posts Monday June 3, 2013Registration dateModeratorStatus November 2, 2018 Last seen - Mar 23, 2018 at 03:28 PM
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

Something to say? Add comment

CCM has helped 1447 users this month

the sql in the server is correct but, in the web it still got an unidentified index
ac3mark 10759 Posts Monday June 3, 2013Registration dateModeratorStatus November 2, 2018 Last seen - Mar 23, 2018 at 03:53 PM
What credentials do the web server use to connect?
Respond to ac3mark