Jump to content

Multiple Field form to add new info into SQL Database


phptim25

Recommended Posts

Hi,

 

Im very very new to PHP and SQL, which im using for a college project to have an assett tracking database for test equipment.

 

So far has been so good up until now. The problem Ive been having is that I want to add new testers and have come unstuck.

 

This is the main part of the code on the form page:

 

<?php

 

 

foreach($labels as $field => $label)

{

  echo "<div class='field'>

          <label for='$field'>$label</label>

          <input type='text' name='$field' id='$field'

            size='40' maxlength='65' value='".@$$field."' /></div>\n";

}

?>

<div id="submit" align="center">

<input type='hidden' name='RochTest' value='RochTest'/>

<input type='submit' value='Submit Details' />

<input type='submit' name='newbutton' value='Cancel' />

</div> </form></body></html>

 

There is a little more to the code although its only creating the array and organising the form layout.

 

Want I want to know is how I can use the submitted to put into my sql database?

 

Your help would be very much appreciated :-)  :-*

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.