im trying to pass a variable, and i did work but not completly, i want to know if im doing it wrong or if what im trying to do cant be done thanks for help
After the id was passed:
$stock_id = $_POST['id'];
i want to select rows from a table that contain this id
$sql_getinfo = "SELECT *
FROM transac_user
WHERE id=" .$stock_id;
$row_info = mysqli_fetch_array($sql_getinfo, MYSQLI_ASSOC);
$company_id = $row_info['company_id'];
$company_shares = $row_info['amount_bought'];
$company_price = $row_info['price_bought'];
and then delete the transaction
$sqldelete = "DELETE FROM transac_user WHERE id=".$stock_id;
$result = mysqli_query($db, $sqldelete);
What i want to do, is passed the variable, get some info from the table where its id is equal, get those values and insert them in another table(theres update and insert codes after) and then delete the row.. The delete only works, but i cant get value for the first select statement. tried only the select statement, and it dont work
If you need anymore info, this is really important for me as this is for my final year project. thank you