Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "xxxxx";
- $password = "xxxxx";
- $dbname = "xxxxx";
- $dateTimeVariable = date( "Y-m-d H:i:s" );
- $stock = -$_POST[ sto ];
- // Create connection
- $conn = new mysqli( $servername, $username, $password, $dbname );
- // Check connection
- if ( $conn->connect_error ) {
- die( "Connection failed: " . $conn->connect_error );
- }
- if ( !empty( $_POST[ 'vnos' ] ) ) {
- $sql = "INSERT INTO StockEntry (part_id, user_id, stockLevel, price, dateTime, correction, comment)
- VALUES ('$_POST[vnos]', '3', '$stock', '', '$dateTimeVariable', '0', 'test')";
- if ( $conn->query( $sql ) === TRUE ) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement