I've just started PHP/MySQL and I'm having a bit of trouble with the site I'm making. This certain page shows if a link is validated, pending or deleted. People submit the ID into the form and it displays one of the above. The problem is it's just showing nothing when I enter a test id. The part of the script is <form action='<?php echo "$self?action=submit"; ?>' method='post'> <input name='statusid' type='text' size="10" maxlength='20'><br /> <input type='Submit' name='submit' value='Check Status'> </form> <?php if(isset($_POST['submit'])) { $statusid = mysql_real_escape_string(strip_tags($_POST['statusid'])); $status = mysql_fetch_assoc(mysql_query("SELECT is_validated FROM links WHERE id = '$statusid'")); $error_msg = array(); if(empty($statusid)) { $error_msg[] = "Please insert a ID!<br />"; } if(count($errors) > 0) { echo "<strong>ERROR:</strong><br>"; echo "$error_msg"; } if(($status) == "0") { echo "Unverified"; } elseif(($status) == "1") { echo "Verified"; } elseif(($status) == "2") { echo "Deleted"; } } ?> Code (markup): It is already connected to to the db from a small part of the script above. It's probably a stupid error somewhere but like I said, I'm new
<br /> ????? Could that be an error....I don't see a mySql connection part either {atleast I think so}
I don't quite get what you mean by the <br /> being an error. The mysql connection is further up the page, I havn't put it on here.
this part : if(($status) == "0") { echo "Unverified"; } elseif(($status) == "1") { echo "Verified"; } elseif(($status) == "2") { echo "Deleted"; } } Code (markup): should have $status["is_validated"] not just $status edit : like : if($status["is_validated"] == 0) { echo "Unverified"; } elseif($status["is_validated"] == 1) { echo "Verified"; } elseif($status["is_validated"] == 2) { echo "Deleted"; } } Code (markup): You also have other errors in the script (echo the array?)