You need an <input>
element as well.
<input type="text" name="RoomName">
This way the value is available by $_POST['RoomName']
. You likely also need a submit button:
<input type="submit" value="Submit">
The label
just associates the label with an input
element, usually with the for
attribute pointing to the input
element's id
:
<label for="RoomName">Room1</label>
<input type="text" id="RoomName" name="RoomName">
The benefit of this is mainly in accessibility (screen readers, clicking label, etc).
To learn more about HTML forms, go through this quick guide: http://www.w3schools.com/html/html_forms.asp
As to the SQL query, read the comments others posted to your question. You need to quote strings and escape the values from SQL injections as well.
Update: as per your edit, just set the readonly
attribute to avoid the field being edited:
<input type="text" id="RoomName" name="RoomName" value="somevalue" readonly>
or make use of a hidden input element:
<input type="hidden" name="RoomName" value="somevalue">