Hi ive got this bit of code, trying to reteach myself stuff about PHP ive forgotten and having a general play. However i can only get this code to half work
<?php
include_once("connect.php");
$username=$_POST['username'];
$password=$_POST['password'];
$email=$_POST['email'];
$existing= "select * from CSLE_User where Username = '$username'";
$exist=mysql_query($existing) or die (mysql_error());
$num=mysql_numrows($exist) or die (mysql_error());
if($num != 0)
{
echo "<center><p>computer Says No</p></center>";
}
else
{
echo "<center><p>Test Wins</p></center>";
}
?>
I wanted the form to check weather the user being created was already in the database. It half works.
What I expect is when it finds something it posts the line "Computer says no" which works fine i have a user called A there and if i try to add another user called A it says "Computer says no"
However when i try add a user called B im expecting to see "Test Wins" but instead im presented with a blank screen.
Im sure its somthing stupid ive missed but looking though it all im not sure, also wasnt sure if this was classed as PHP or MYSQL, but as it seems the MYSQL works it must be the way ive presnted the PHP part