Table row is not adding !!!


HOME ยป Databases

I'm a learner of PHP and MySQL. For learning purpose I'm trying to enter a table row using Terminal. But unfortunately, the row is not adding to the table and there is no confirmation. The code is below :
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, how_many, alien_description, what_they_did, fang_spotted, other, email) VALUES ('Sally', 'Jones', '3 days ago', '1 day', 'four', 'green with six tentacles', 'We just talked and played with a dog', 'yes', 'I may have seen your dog. Contact me.', 'sally@gregs-list.net')
When I'm issuing
Syntax: [ Download

Related to : Table row is not adding !!!
Table row is not adding !!!
Databases
I'm a learner of PHP and MySQL. For learning purpose I'm trying to enter a table row using Terminal. But unfortunately, the row is not adding to the table and there is no confirmation. The code is below :
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, how_many, alien_description, what_they_did, fang_spotted, other, email) VALUES ('Sally', 'Jones', '3 days ago', '1 day', 'four', 'green with six tentacles', 'We just talked and played with a dog', 'yes', 'I may have seen your dog. Contact me.', 'sally@gregs-list.net')
When I'm issuing
Syntax: [ Download
Adding a table row full of elements to the end of a table programatically
Databases

Hello, I want for the user to be able to click on a button that lets them add a <tr> full of <td>'s and <input>'s in the <td> tags. So I have code like:

<script type="text/javascript">function addRow(){// Insert a row too the table with td's and input's}</script><table><tr><td><input type="text" name="part1" /></td><td><input type="text" name="price1" /></td></tr><tr><td><input type="text" name="part2" /></td><td><input type="text" name="price2" /></td></tr></table><form><input type="button" o
Help me I cant figure out what the error is when adding a new row to a table .
Databases

Here is my code.


INSERT INTO employees
(1.Last_Name,2.First_Name,3.Title,4.Title_of_Courtesy5.,BD,6.Hire_Date,7.Address,8.City,9.State,10.Zip,11.Country,12.Extension,13.Notes,14. Reports_to,15.Photo);
VALUES (1, 'Smith', 'Janet', 'Sales Manager', 'Mrs.', '12-30-1974', '08/05/2000', '123 My Street', 'canton', 'OH', '44720', 'USA', '4632', 'MBA from Ashland University', 'Andrew Fuller', 'No Photo Available Yet');

Here is error message...Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'Last_Name'.


Adding a row to an existing table
Databases

Im trying to add a new row in case a button is clicked. This row should be added right after the row the button is inside of. Im using Jquery(1.10.2) to add new rows.

The problem I'm encountering is the .closest function doesn't work like I'm expecting it to. When I plaste an hardcoded class to the .insertAfter, it works.

This line of code does not work for me:

$("<tr> <td> Test </td>
</tr>").insertAfter($(this).closest('.rowToClone'));

As I said, when I'm hardcoding a class into the .insertAfter(), it does work. So I guess my problem lays in the .closest() funcion Edited (Whole jquery):

<script>

    var dagen = ["Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"];

    var selects = [];
    var lengte = dagen.length;

        function addRow()
        {
            for(var i = 0; i < lengte; i++)
            {
                //Get all of the hours selected by the Dropdown boxes
                selects[i] = $('select[name="' + dagen[i] + '_uurTot"]
option:selected').text();

                // clone these boxes and changing the name, adding
value of I from the for loop to the name Example Ma1_uurVan
                //selectVan = $('select[name="' + dagen[i] +
'_uurVan"]').clone();
                //selectVan.attr("name", dagen[i] + i + "_uurVan");

                // clone these boxes and changing the name, adding
value of I from the for loop to the name Example Ma1_uurTot
                //selectTot = $('select[name="' + dagen[i] +
'_uurTot"]').clone();
                //selectVan.attr("name", dagen[i] + i + "_uurVan");

                // If the hours those are selected not 22:00,
duplicating the row is possible.
                if(selects[i] !== '22:00')
                {
                    $("<tr> <td> Test </td>
</tr>").insertAfter('.rowToClone'); // Works, but adds row to
all the rows with .rowToClone
                    // $("<tr> <td> Test </td>
</tr>").insertAfter($(this).closest('.rowToClone')); // DOES NOT
WORK


                }
            }

        }
</script>

This is my html:

<table id="beschikbaarheid" class="table table-bordered
table-striped">
    <input type="hidden" name="control" value="admin"/>
    <input type="hidden" name="action" value="beschikbaarheid"/>
    <thead>
        <th class="hidden-xs "
style="color:white;">Dag</th>
        <th class="hidden-xs "
style="color:white;">Van</th>
        <th class="hidden-xs "
style="color:white;">Tot</th>
        <th class="hidden-xs " style="color:white;">Rij
aanmaken</th>
        <th class="hidden-xs "
style="color:white;">Status</th>
     </thead>
     <tbody>
        <tr class="rowToClone">
             <td>Maandag <td>
             <select name="Ma_uurVan">
                  <option value="08:00">08:00</option>
                  <option value="08:30">08:30</option>
                  <option value="09:00">09:00</option>
                  <option value="09:30">09:30</option>
                  <option value="10:00">10:00</option>
                  <option value="10:30">10:30</option>
                  <option value="11:00">11:00</option>
                  <option value="11:30">11:30</option>
                  <option value="12:00">12:00</option>
                  <option value="12:30">12:30</option>
                  <option value="13:00">13:00</option>
                  <option value="13:30">13:30</option>
                  <option value="14:00">14:00</option>
                  <option value="14:30">14:30</option>
                  <option value="15:00">15:00</option>
                  <option value="15:30">15:30</option>
                  <option value="16:00">16:00</option>
                  <option value="16:30">16:30</option>
                  <option value="17:00">17:00</option>
                  <option value="17:30">17:30</option>
                  <option value="18:00">18:00</option>
                  <option value="18:30">18:30</option>
                  <option value="19:00">19:00</option>
                  <option value="19:30">19:30</option>
                  <option value="20:00">20:00</option>
                  <option value="20:30">20:30</option>
                  <option value="21:00">21:00</option>
                  <option value="21:30">21:30</option>
                  <option value="22:00">22:00</option>
              </select>
          </td>
          <td>
              <select name="Ma_uurTot">
                  <option value="08:00">08:00</option>
                  <option value="08:30">08:30</option>
                  <option value="09:00">09:00</option>
                  <option value="09:30">09:30</option>
                  <option value="10:00">10:00</option>
                  <option value="10:30">10:30</option>
                  <option value="11:00">11:00</option>
                  <option value="11:30">11:30</option>
                  <option value="12:00">12:00</option>
                  <option value="12:30">12:30</option>
                  <option value="13:00">13:00</option>
                  <option value="13:30">13:30</option>
                  <option value="14:00">14:00</option>
                  <option value="14:30">14:30</option>
                  <option value="15:00">15:00</option>
                  <option value="15:30">15:30</option>
                  <option value="16:00">16:00</option>
                  <option value="16:30">16:30</option>
                  <option value="17:00">17:00</option>
                  <option value="17:30">17:30</option>
                  <option value="18:00">18:00</option>
                  <option value="18:30">18:30</option>
                  <option value="19:00">19:00</option>
                  <option value="19:30">19:30</option>
                  <option value="20:00">20:00</option>
                  <option value="20:30">20:30</option>
                  <option value="21:00">21:00</option>
                  <option value="21:30">21:30</option>
                  <option value="22:00">22:00</option>
              </select>
           </td>
        <td>
            <button type="button" onclick="addRow()"> Voeg rij
toe </button>
        </td>
        <td>
        <select name="StatusMa">
            <option>Beschikbaar</option>
            <option selected >Niet beschikbaar</option>
            </select>
        </td>
    </tr>

edit: Because of the large sum of html code. I only inserted the first whole row.


SQL Server 2005 - Adding around 200 rows in a table grows size of the table by 400kb where avg row size is 0.2KB
Databases

Not very familiar with DB tuning and its internals overall so I might be missing something here. We are running into an issue where if we look at the avg row size (0.2kb) x number of rows (200) inserted in one of our table, the size should grow by around 40 KB. However the total used space has increased by around 400 KB. I believe there is additional index size to be considered. However it still should not show this big difference. What possibly should we look at to understand this difference and what is happening?

This is happening with couple of our tables which only do inserts related to data collected from a third party system. It does not do any updates on any rows. Also we have an index on the table on the primary key which is an ID (number) field.


Adding row to a table with Javascript
Databases

I am just doing a Javascript excercise which should add a row into a table. Html reads like this:

<!DOCTYPE html>  
<html><head><br><meta charset=utf-8 />  
<title>Insert row in a table - w3resource</title>  
</head><body>  
<table id="sampleTable" border="1">  
<tr><td>Row1 cell1</td>  
<td>Row1 cell2</td></tr>  
<tr><td>Row2 cell1</td>  
<td>Row2 cell2</td></tr>  
</table><br>  
<input type="button" onclick="insert_Row()" value="Insert row"> 
 
</body></html>  

And my script that doesn't work:

function insert_Row(){
  var xTable=document.getElementById('sampleTable');
   for (i=0;i<=xTable.children.length;i++)
   {
    if(i===xTable.children.length)
    {
      xTable.createElement('tr');

    }

  }

}

This is the correct solution:

function insert_Row()
{
var x=document.getElementById('sampleTable').insertRow(0);
var y = x.insertCell(0);
var z = x.insertCell(1);
y.innerHTML="New Cell1";
z.innerHTML="New Cell2";
}

but would like to understand what is wrong with my first solution? Why doesn't it create the tag?



Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .