Jump to content

Help me (PHP)


Monk3h

Recommended Posts

Right, this Code 'Should work' and yet dosnt.. Its the PHP and not the SQL because instead of just displaying the 'else' Part of the code when i have Gembag as s it still displays the first bit. Now i know it gives me the gembag and changes it to 's' from 'n' in the database but it still only shows the first if part of the code and not the else. :s

 

<?php $title = "Gem Store"; include("header.php"); ?>

<b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many diferent Priceless Stones..<br><br><br> 

<?php
if ($stat[gembag] = n ) {

	Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>";

	Print "<b>Store Assistant:</b> Here, take this.. Its on the house, but dont get telling people we do FreeBs!<br><br>";

	Print "The store Assistant hands you a <b>Small Gem Bag</b>";

mysql_query("update players set gembag='s' where id=$stat[id]");

include("footer.php");
exit; } 


else {
		Print "<b>Store Assistant:</b> How are you getting on with that <i>Small Gem Bag</i>? Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.";

include("footer.php");
exit; }

?>
<?php include("footer.php"); ?>

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.