Note that there are some explanatory texts on larger screens.

plurals
  1. POMysql Problem with html and php
    text
    copied!<p>I have a table called Stafflist which is called and lists all of the members on the page.<br> I then want to have some text boxes for each person which are editable.<br> When the submit button is clicked I want it to insert the staff name and the relevant info from the page into a separate table called Services</p> <p>The code I've got is just pulling at the moment and no inserting is done. </p> <p>I would be grateful for an example of how to achieve this.</p> <p><em>Security isn't an issue right now as I'm going to go through and look at the security part at a later date</em></p> <pre><code>&lt;?php include 'dbc.php'; page_protect(); company(); $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION[branch]' "); if (checkAdmin()) { ?&gt; &lt;html&gt;&lt;head&gt;&lt;title&gt;Book Off Holiday&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;script src="php_calendar/scripts.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="styles.css" rel="stylesheet" type="text/css"&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="form" action="Newkpi.php" method="post"&gt; &lt;table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"&gt; &lt;tr&gt; &lt;td colspan="3"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;td width="160" valign="top"&gt; &lt;?php if (isset($_SESSION['user_id'])) { } ?&gt; &lt;a href="admin.php"&gt;Admin CP &lt;/a&gt; &lt;/td&gt; &lt;td width="732" valign="top"&gt; &lt;p&gt; &lt;h3 class="titlehdr"&gt;New KPI&lt;/h3&gt; &lt;table width="300px" border="0" align="Centre" cellpadding="2" cellspacing="0"&gt; &lt;tr bgcolor="#000050"&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Staff Member&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Service Amount&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Service Date&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Forecast For Next Month&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Product Sales&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Clients This Month&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Personel Retension&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Total Retension&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Colours&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Cuts&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Pre-Booking&lt;/h3&gt;&lt;/td&gt; &lt;td width="20px"&gt;&lt;h3 class="Text2"&gt;Time Used&lt;/h3&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php while ($rrows = mysql_fetch_array($stafflist)) { ?&gt; &lt;tr&gt; &lt;td name="user_name"&gt;&lt;h3 class="Text3"&gt;&lt;?php echo $rrows['full_name'];?&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="Serviceamount" type="text" size="4" id="Serviceamount"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="servicedate" type="text" size="4" id="servicedate"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="forecast" type="text" size="4" id="forecast"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="productsales" type="text" size="4" id="productsales"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="Clientsthismonth" type="text" size="4" id="Clientsthismonth"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="Personelret" type="text" size="4" id="Personelret"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="Totalret" type="text" size="4" id="Totalret"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="colours" type="text" size="4" id="colours"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="cuts" type="text" size="4" id="cuts"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="prebooking" type="text" size="4" id="prebooking"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;td&gt;&lt;h3 class="Text3"&gt;&lt;input name="timeused" type="text" size="4" id="timeused"&gt;&lt;/h3&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt; &lt;input name="doSubmit" type="submit" id="doSubmit" value="Create"&gt; &lt;/td&gt;&lt;/table&gt;&lt;/form&gt;&lt;/body&gt;&lt;/html&gt; &lt;?php } ?&gt; </code></pre> <p>Thank you in advance for any help</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload