title: Insert append data into mysql database using python
body: <p>I have face some issue to mu code when I want to insert student matrix number into mysql database table. In my code I have use append() function to collect student's matrix number. When I pass the matrix_num.append() to database. The result in the database show 0 in Matrix_Number's column and it also show student's matrix number in one row only. The database should store 3 student's matrix due to   the output have 3 matrix number (19876, 23456, 13791846). I have attach my code, output and database result. Anyone have idea? Thank you.</p>
  <p><strong>Code:</strong></p>
  <pre><code>number = (int(pred[0]))
  num_list_matrix.append(number)       //matrix number of each student
  matrix_num.append(num_list_matrix)   //matrix number collected from 3 students 
  
  
  print(&quot;Number: &quot;, number)
  print (&quot;Matrix number: &quot;, num_list_matrix)
  print(&quot;Students mtrix num: &quot;, matrix_num) 
  
  `StudentMarks = &quot;INSERT INTO students_mark (Matrix_Number) VALUES (%s)&quot;
  matrixnumber = [&quot;matrix_num&quot;]
  mycursor.execute(StudentMarks, matrixnumber)
  
  mysqlconnect.commit()
  print(&quot;Record Saved Successfully...!&quot;)
  
  
  mycursor.close()
  mysqlconnect.close()
  print(&quot;MySQL connection is closed&quot;)`
  </code></pre>
  <p><strong>Output:</strong></p>
  <p><a href="https://i.stack.imgur.com/tz2rO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tz2rO.png" alt="Output:" /></a></p>
  <p><strong>Database output:</strong>
  <a href="https://i.stack.imgur.com/iBRbr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iBRbr.png" alt="Database output" /></a></p>