Jump to content

Data insert help...


skendo

Recommended Posts

Where i am doing mistake..?

Is adding but it add's empty data :(

 

<head>

<title>Advertiser Signup</title>

</head>

<body bgcolor=white>

Welcome to signup Page<br>

<font color=red size=5>

<?php

$dbid = mysql_connect('localhost','xxxx','xxxxx');

mysql_select_db("xxxxxxx",$dbid);

$clientid = $_POST [dbInsertID];

$clientusername = $_POSTT[clientusername];

$clientpassword = $_POST[clientpassword] = md5($clientpassword);

$email = $_POST;

$clientmae = $_POST[clientname];

mysql_query("INSERT INTO my_clients (clientid, clientname, clientusername, clientpassword, email)

VALUES ('$clientid', '$clientname', '$clientusernmae', '$clientpassword', '$email')");

 

?>

 

</font>

<p><form method="post">

Name Surname:

<input type="text" name"$clientname" size="30" /><br />

E-mail:

<input type="text" name"$email" size="30" /><br />

Password:

<input type="text" name"$clientpassword" size="30" /><br />

Name Surname:

<input type="text" name"$clientusername" size="30" />

 

<input type="submit" value="Signup"

</form>

</body>

Link to comment
Share on other sites

Please put your code into the CODE TAGS.

 

<input type="text" name"$clientname" size="30" /><br />
E-mail:
<input type="text" name"$email" size="30" /><br />
Password:
<input type="text" name"$clientpassword" size="30" /><br />
Name Surname:
<input type="text" name"$clientusername" size="30" />

 

your missing names for your input types, and for some reason you have variables beside them

 

 

try this, but you don't have a input field for clientID ,

<head>
<title>Advertiser Signup</title>
</head>
<body bgcolor=white>
Welcome to signup Page<br>
<font color=red size=5>
<?php
$dbid = mysql_connect('localhost','xxxx','xxxxx');
mysql_select_db("xxxxxxx",$dbid);
$clientid = $_POST ['dbInsertID'];
$clientusername = $_POST['clientusername'];
$clientpassword = md5($_POST['clientpassword']);
$email = $_POST['email'];
$clientname= $_POST['clientname'];   
mysql_query("INSERT INTO my_clients (clientid, clientname, clientusername, clientpassword, email)
VALUES ('$clientid', '$clientname', '$clientusernmae', '$clientpassword', '$email')");

?>

</font>
<p><form method="post">
Name Surname:
<input type="text" name="clientname" size="30" /><br />
E-mail:
<input type="text" name="email" size="30" /><br />
Password:
<input type="text" name="clientpassword" size="30" /><br />
Name Surname:
<input type="text" name="clientusername" size="30" />

<input type="submit" value="Signup"
</form>
</body>

Link to comment
Share on other sites

and also instad of 1 it adds 2 rows at same time...

can some one give me a code example

 

That i can add data to database

 

that will ad random ID

Add username

Password

email

Name/Surname

 

I am a beginner so really need help.

Link to comment
Share on other sites

I am going to pull my hair out today. You need to give your button a name. I suggest you read some basic HTML before tackling php.

 

try this.

<head>
<title>Advertiser Signup</title>
</head>
<body bgcolor=white>
Welcome to signup Page<br>
<font color=red size=5>
<?php
if($_POST['submit'] != ""){
$dbid = mysql_connect('localhost','xxxx','xxxxx');
mysql_select_db("xxxxxxx",$dbid);
$clientid = $_POST ['dbInsertID'];
$clientusername = $_POST['clientusername'];
$clientpassword = md5($_POST['clientpassword']);
$email = $_POST['email'];
$clientname= $_POST['clientname'];   
mysql_query("INSERT INTO my_clients (clientid, clientname, clientusername, clientpassword, email)
VALUES ('$clientid', '$clientname', '$clientusernmae', '$clientpassword', '$email')");
}
?>

</font>
<p><form method="post">
Name Surname:
<input type="text" name="clientname" size="30" /><br />
E-mail:
<input type="text" name="email" size="30" /><br />
Password:
<input type="text" name="clientpassword" size="30" /><br />
Name Surname:
<input type="text" name="clientusername" size="30" />

<input type="submit" name="submit" id="submit" value="Signup"
</form>
</body>

Link to comment
Share on other sites

and also instad of 1 it adds 2 rows at same time...

can some one give me a code example

 

That i can add data to database

 

that will ad random ID

Add username

Password

email

Name/Surname

 

I am a beginner so really need help.

 

Random ID is called a primary/unique Key with an auto_increment, every tables needs to have one, not always but depending on what your doing.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.