Hi guys. First I have spent awhiel trying to find an answer for this online and haven't been able to. I have defined a variable ($new) in the beginning of my page. to test that is IS defined right i echo'd it...im using nested if statements to check thing. in the second if statement for some reason the variable is redefined to 'yes'. why is this? all the code isnt doine..im testing as i go useing text just to see that things are being evaluiated right..here is the code...

$query1="SELECT * FROM $clean_title WHERE lname='$last_name' AND fname='$first_name' AND first='yes'";
$result1=mysql_query($query1) or die(mysql_error());
if (mysql_num_rows($result1) > 0)
        {
        if ($new="yes")
                {
                echo'
                This character has already been entered as new
                ';
                }
                else
                {
                echo'
                Character can be entered into database
                ';
                }
        } 
        else
        {
        echo'
        Character can be entered into database
        ';
        }

mysql_close();

Pleas help. I know I just must be doing something wrong someweher but I can't see it.

Recommended Answers

All 2 Replies

Member Avatar for diafol

Try

$new=="yes"

Try

$new=="yes"

excellent! thank you! i KNEW it had to be something small i was missing!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.