Hi, I have a small problem. This is the code: <?php if ( $info->exp <> 100) { echo "You reach 100% before you can submit."; } else { ?><td><input name="button" type="submit" id="button3" value="Submit"></td><?php } ?> PHP: According to this, what do I need to have declared before? I've already declared $info: $info=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'")); PHP: Also, is the 1st snipped of code correct?
It should be >= instead of <>...if you want it less than or equal. Plus if you want to get exp from the database, the select should be: "SELECT exp FROM user_info WHERE username='$username'" Because of this, you're first line of code would be: <?php if ( $info['exp'] <= 100) {
<?php if ( $info->exp <> 100) { echo "You reach 100% before you can submit."; } else { ?><td><input name="button" type="submit" id="button3" value="Submit"></td><?php } ?> PHP: Forgot a few things: <?php require('./path/to/class/file'); $info = new classname(); if ( $info->exp != 100) { echo 'You reach 100% before you can submit.'; } else { echo '<td><input name="button" type="submit" id="button3" value="Submit"></td>'; } ?> PHP:
Ok, thanks What i'm trying to do is say: if EXP does not equal 100, display message about insufficient exp. If EXP = 100, display submit button