From:
Operating system: windows
PHP version: 5.3.2
Package: Output Control
Bug Type: Bug
Bug description:nothing
Description:
------------
<?php
include 'mysql-connect.php';
$username = $_POST['username'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$age = $_POST['age'];
$ip = $_SERVER['REMOTE_ADDR'];
$result = mysql_num_rows(mysql_query("SELECT * FROM te2 WHERE
username='$username'"));
if($result == 1)
{
echo "username already exist";
}
else
{
mysql_query("INSERT INTO te2 (username, password, firstname, lastname,
age, ip)
VALUES ('$username', '$password', '$firstname', '$lastname', '$age',
'$ip')");
echo "u are successfully registered";
<p>Click <a href="login.php">here</a> to login.</p>;}
?>
Expected result:
----------------
<?php
include 'mysql-connect.php';
$username = $_POST['username'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$age = $_POST['age'];
$ip = $_SERVER['REMOTE_ADDR'];
$result = mysql_num_rows(mysql_query("SELECT * FROM te2 WHERE
username='$username'"));
if($result == 1)
{
echo "username already exist";
}
else
{
mysql_query("INSERT INTO te2 (username, password, firstname, lastname,
age, ip)
VALUES ('$username', '$password', '$firstname', '$lastname', '$age',
'$ip')");
echo "u are successfully registered";
<p>Click <a href="login.php">here</a> to login.</p>;}
?>
Actual result:
--------------
in my code insert into values code dont work .pls help me
--
Edit bug report at http://bugs.php.net/bug.php?id=51747&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51747&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51747&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51747&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51747&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51747&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51747&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51747&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51747&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51747&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51747&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51747&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51747&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51747&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51747&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51747&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51747&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51747&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51747&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51747&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51747&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51747&r=mysqlcfg