Hey, im trying to make a code that will will one the first page make a list of items for the specific input the user gives.
And then when the user press edit next to the item open a page where the user can edit the info stated in the database
But atm I can’t seem to get the code to send the data when the user presses edit.
It only transfers to the edit.php but it doesen’t enter the data in the input box.
Here is the 2 codes.
test_edit.php
[php]<?php
error_reporting (E_ALL ^ E_NOTICE);
session_start();
$userid = $_SESSION[‘userid’];
$username = $_SESSION[‘username’];
?>
"; echo " Choose year:
"; echo " Choose Department: "; while ($row2 = mysql_fetch_array($dep)){ echo '' . $row2['name'] . '';} echo "
"; echo " "; ?> <?php if (isset($_POST['submit'])){ $week_r = $_POST['week']; $dep_r = $_POST['department']; $sql=mysql_query("SELECT * FROM `Marketing` WHERE Week = '$week_r' and Department = '$dep_r'"); if (mysql_num_rows($sql) < 0){ $output = "Sorry there is no data with these values"; }else{ echo "
Week | Brand | Product | Department | Group | Number | Product Type | Display Type | Count | Price | Goodsnr | Username | "; while ($rows = mysql_fetch_array($sql)){ echo '|
---|---|---|---|---|---|---|---|---|---|---|---|---|
'. $rows['Week'] .' | '; echo ''. $rows['Brand'] .' | '; echo ''. $rows['Product'] .' | '; echo ''. $rows['Department'] .''; echo ' | '. $rows['Group'] .' | '; echo ''. $rows['Number'] .' | '; echo ''. $rows['ProductType'] .' | '; echo ''. $rows['DisplayType'] .' | '; echo ''. $rows['Count'] .' | '; echo ''. $rows['Price'] .' | '; echo ''. $rows['Goodsnr'] .' | '; echo ''. $rows['Username'] .' | '; echo "edit | "; echo "