SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple entries in database

    Hello Friends,

    I have a very simple table which contains 5 rows having 4 columns.

    The columns are label, Dropdown menu, Texbox, Textarea respectively

    Suppose the student enters 2 rows than it shuld go in the datbase like

    id | student_id | local/central | duties | skills
    --------------------------------------
    1 | 1 | local | duties1 | skills1
    2 | 1 | central | duties2 | skills2

    And if the user doesn't enter the last 2 or 3 rows it shuld not go in the database..So basically I dont know how to insert multiple entries.

    Here is my code

    HTML Code:
    <html>
    <table width="40%" align="left" cellpadding="4" cellspacing="0">
    <tr>
    <th valign="top" align="left">Unit</th>
    <th valign="top">Local/Central</th>
    <th valign="top">Duties</th>
    <th>Skill Set</th>
    </tr>
    <tr>
    <td valign="top" width="4%">1</td>
    <td valign="top" width="3%"><select>
    <option value="volvo">Local</option>
    <option value="saab">Central</option></select></td>
    <td valign="top" width="3%"><input type="text"></td>
    <td width="10%"><textarea rows="5" cols="30"> 
    </textarea></td>
    </tr>
    
    <tr>
    <td valign="top" width="4%">2</td>
    <td valign="top" width="3%"><select>
    <option value="volvo">Local</option>
    <option value="saab">Central</option></select></td>
    <td valign="top" width="3%"><input type="text"></td>
    <td width="10%"><textarea rows="5" cols="30"> 
    </textarea></td>
    </tr>
    
    <tr>
    <td valign="top" width="4%">3</td>
    <td valign="top" width="3%"><select>
    <option value="volvo">Local</option>
    <option value="saab">Central</option></select></td>
    <td valign="top" width="3%"><input type="text"></td>
    <td width="10%"><textarea rows="5" cols="30"> 
    </textarea></td>
    </tr>
    
    <tr>
    <td valign="top" width="4%">4</td>
    <td valign="top" width="3%"><select>
    <option value="volvo">Local</option>
    <option value="saab">Central</option></select></td>
    <td valign="top" width="3%"><input type="text"></td>
    <td width="10%"><textarea rows="5" cols="30"> 
    </textarea></td>
    </tr>
    
    <tr>
    <td valign="top" width="4%">5</td>
    <td valign="top" width="3%"><select>
    <option value="volvo">Local</option>
    <option value="saab">Central</option></select></td>
    <td valign="top" width="3%"><input type="text"></td>
    <td width="10%"><textarea rows="5" cols="30"> 
    </textarea></td>
    </tr>
    <tr>
    <td valign="top" colspan="4"><input type="Submit" name="Submit" value="Save" onClick="javascript:subit(1);"></td>
    </tr>
    </table>
    
    
    </html>

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you need a introduction to html/php and how to create html forms and process them with php. Then add the mysql stuff. Look for form processing with php.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •