Jump to content

adding from drop down to database


grlayouts

Recommended Posts

Ok i have a script where if you select one of the drop downs, if you have the cash in your credits it will update the database as you having one of them.

 

HOWEVER every time it goes on it gives the player a steak house without clicking on it.

 

anyone?

 

<? print "<form method=post action=enterprises.php?view=add&step=add>Build  <select name=building><option value=DrugFactory>Drug Factory</option><option 	value=SteakHouse>Steak House</option><option 	value=CarLot>Car Lot</option><option 	value=Passport>Passport</option></select>. <input type=submit value=Add></form>";
if ($step == add) {
if ($building = 'DrugFactory') {
if ($stat[credits] <30000) {
print "Sorry mate, you don't have the cash.";
} else {
	mysql_query("update players set drugfact=drugfact+1 where id=$stat[id]");
		print "Building added."; }}}
	 else 
if ($building = 'SteakHouse') {
if ($stat[credits] <60000) {
print "Sorry mate, you don't have the cash.";
} else {
	mysql_query("update players set steakhouse=steakhouse+1 where id=$stat[id]");
		print "Building added."; }}



		?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.