hey guys, im having some trouble with a school assignment of mine. the assignment buids on previous assignments. this one consists of a mysql database that has different brands of coats, sizes, and stock available of the coat (like a coat distributor).
this is what i have so far:
now i dont have any problems this far, but im confused on how to redirect to an update page that will allow the user to update the quantity. how its supposed to work us the user can click the edit link next to a quantity, and it will take the user to a form where he can put in a new quantity then hit an update button. im not sure how to redirect to the edit page.
below are some screenshots of my html table and my tables in my database:
thanks for any help in advance
this is what i have so far:
Code:
<?php
////////// CONNECT TO SERVER //////////
$dbcnx = @mysql_connect('localhost', 'dbase18', 'newer333') or die ('I cannot connect to the database because: ' .mysql_error());
///////// CONNECT TO DATABASE ////////////
mysql_select_db('dbase18', $dbcnx);
if (!@mysql_select_db('dbase18')) {
exit ('<p>Error in query.'. mysql_error(). '<p>');
}
////////// MAKE AN HTML TABLE TO HOLD THE DATA ////////////
?>
<table>
<tr>
<td><strong>Brand</strong></td>
<td><strong>Stock (XXL)</strong></td>
<td><strong>Update</strong></td>
</tr>
<?php
//////////// QUERY DATABASE /////////////
$queryresult = @mysql_query('select brand.id, brand_name, stock from brand left join stock on brand.id = stock.brand_id left join size on size.id = stock.size_id where size.id = 3;');
if (!$queryresult) {
exit ('<p>Error in query.'. mysql_error().'</p>');
}
/////////// RESULTS OF QUERY AND PUBLISH TO TABLE ///////////
while ($row = mysql_fetch_array($queryresult)){
echo '<tr><td>'.$row['brand_name'].'</td><td>'.$row['stock'].'</td><td><a href=edit.php?id='.$row['id'].'>Edit</a></td></tr>';
}
?>
</table>
now i dont have any problems this far, but im confused on how to redirect to an update page that will allow the user to update the quantity. how its supposed to work us the user can click the edit link next to a quantity, and it will take the user to a form where he can put in a new quantity then hit an update button. im not sure how to redirect to the edit page.
below are some screenshots of my html table and my tables in my database:


thanks for any help in advance