ID:               19950
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         MySQL related
 Operating System: linux
 PHP Version:      4.3.0-pre1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Use $user["new"] instead of $user[new], new is a keyword in PHP. Not a
bug.



Previous Comments:
------------------------------------------------------------------------

[2002-10-17 07:10:50] [EMAIL PROTECTED]

What im trying to do, is check to see if the person is new to signing
up, but the way i did it made me think its a bug.

Think about it like this
would this work, (yes)

<?
$new = 1;
if ($new = 1)
echo "it worked";
?>

Ok, so you know that works, and i know that works, but what about
this.

picture a login form
 <form method=post action=login_go.php>
 <input type=test name=username>
 <input type=submit>
 </form>
You enter your username, and push submit, now you are in login_go.php
with the value carryed by your username

You write
<?
$link = mysql_connect("localhost", "dbuser", "dbpass")
        or die("Could not connect");
$get = mysql_select_db("dbname",$link)
        or die("Could not select Database");

$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE
username='$username';")); //$username from the form

if ($user[new] == "1") // say there was a feild in the table users
called new
 {echo "worked";}
?>
That would not work?, why its so right, theres nothing wrong with that
code, but!, now if u add a w to new in the database feild, and add a w
to user[new] it will work.

I have figure out how to get around it by simply added another w, or
just changing the word new all together. Is new a functions of some
type,  or is it a bug when you use it like that. It really doesnt make
sense to me, and the people who ive ask about this.

I hope you can give me a anwser to this question, cause i am very
curious, and so are my friends.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19950&edit=1

Reply via email to