Jump to content

how to enter one row record from more than 1 input fields


mizraabi

Recommended Posts

hi guys

i want to knw tht how do i get one row record from more than one input fields

for example

i want to get the Name of a person i m getting it like First Name,Last Name,Title,Suffix

now i want to store them in one row in the MySql table.

I tried to do tht by giving the same name to all the input fields but tht overwrites the previous record.

 

Plz help :(

Link to comment
Share on other sites

Why dont you make seperate rows: first_name, last_name, ect.....

 

and echo out in a line.

 

<?php echo $first_name; ?> <?php echo $last_name; ?>

 

Then you are more free to do things in the future, like "Welcome! Joe"

 

insted of "Welcome! Joe Blow Title Suffix"

Link to comment
Share on other sites

uhhh create more then one column in your table?

This is the most basic database question.. I HIGHLY recommend you read up on databases.

 

Create a table with the fields you need,

 

then when you insert do

INSERT INTO whatever VALUES(firstname,lastname) etc...

 

Link to comment
Share on other sites

didnt get it man ?

tel me how to do it in MySql.

I want to join the input of two fields in a single row . i dont want to put it into columns

Explain what you mean by fields. Do you mean an HTML field? Or a field in your database? If its an HTML field then all data submitted to the page from a form is handled by PHP. Form data is usually stored in the $_POST super global (depends on your forms submit method), eg $_POST['form_field_name']

 

To join the two variables into one you'd use concatenation, eg

$full_name = $_POST['First_Name'] . ' ' .  $_POST['Last_Name']

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.