grlayouts Posted April 7, 2007 Share Posted April 7, 2007 OK i have a market that displays all items, i.e. steaks, price=100 sell how many? how can i get the selling button to sell and take away from database. <?php $title = "Consumer Market"; include("header.php"); ?> <center> Welcome to the market <table width="100%" cellpadding="2" cellspacing="0" style="width:100%;height:95%;margin-top:10px;border:1px solid #5B84A4;"> <tr bgcolor=#0F354C> <td width=30%>Item</td> <td width=20%>Price</td> <td wdith=30%>Item</td> <td width=20%>You can sell</td> </tr> <tr bgcolor=#5B84A4> <td>Drugs: </td> <td><? print"$stat[drugsell]";?></td> <td>Drugs: </td> <td><? print"$stat[drugs]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Low riders: </td> <td>$0</td> <td>Low riders: </td> <td><? print"$stat[lows]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Steaks: </td> <td>$0</td> <td>Steaks: </td> <td><? print"$stat[steaks]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Beer: </td> <td>$0</td> <td>Beer: </td> <td><? print"$stat[beer]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Bullets: </td> <td>$0</td> <td>Bullets: </td> <td><? print"$stat[bullets]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Hummers: </td> <td>$0</td> <td>Hummers: </td> <td><? print"$stat[hums]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Vests: </td> <td>$0</td> <td>Vests: </td> <td><? print"$stat[vests]";?></td> </tr> <tr bgcolor=#5B84A4> <td>Ak-47: </td> <td>$0</td> <td>Ak-47: </td> <td><? print"$stat[aks]";?></td> </tr> </table> <br /> <table width="57%" height="11%" cellpadding="2" cellspacing="0" style="width:100%;height:95%;margin-top:10px;border:1px solid #5B84A4;"> <tr bgcolor="#0F354C"> <td width="30%"><div align="center">Item</div></td> <td width="20%"><div align="center">Amount to Sell</div></td> </tr> <tr bgcolor="#5B84A4"> <td><div align="center"> <select name="seller"> <option value="1">Drugs</option> </select> </div></td> <td><div align="center"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><input type="text" size="10" value="0" name="Amount" id="id1" /> </td> </tr> </table> <? print"<input type=submit value=Change>"; ?></div></td> <form input name="ammount" id="ammount" value="0" size="10" maxlength="10"> </form> </tr> </table> <br /> </p> </td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/46000-ifs/ Share on other sites More sharing options...
maxic0 Posted April 7, 2007 Share Posted April 7, 2007 Create a drop down menu, so the customers can choose how many they want to buy. Then have a submit button, and when they click submit have a simple UPDATE query to minus the ammount from the database that the customers are buying. Quote Link to comment https://forums.phpfreaks.com/topic/46000-ifs/#findComment-223524 Share on other sites More sharing options...
grlayouts Posted April 7, 2007 Author Share Posted April 7, 2007 i tried that but it didnt work. i have the ammount field and drop down product in place. Quote Link to comment https://forums.phpfreaks.com/topic/46000-ifs/#findComment-223526 Share on other sites More sharing options...
redbullmarky Posted April 7, 2007 Share Posted April 7, 2007 ok, well you've posted the HTML - how about posting the relevent PHP code what you have right now? that'll be the problem, rather than the HTML. Quote Link to comment https://forums.phpfreaks.com/topic/46000-ifs/#findComment-223530 Share on other sites More sharing options...
grlayouts Posted April 7, 2007 Author Share Posted April 7, 2007 if you read the code you'll see the php. Quote Link to comment https://forums.phpfreaks.com/topic/46000-ifs/#findComment-223566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.