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 :(

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"

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...

 

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']

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.