php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51747 nothing
Submitted: 2010-05-05 15:18 UTC Modified: 2010-05-05 17:24 UTC
From: debasishbasak132 at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.3.2 OS: windows
Private report: No CVE-ID: None
 [2010-05-05 15:18 UTC] debasishbasak132 at gmail dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-05 17:24 UTC] degeberg@php.net
-Status: Open +Status: Bogus
 [2010-05-05 17:24 UTC] degeberg@php.net
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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC