Sum all values of the table

Asked

Viewed 42 times

0

I’m trying to sum all the values at once from the table, but it’s giving error, my code: mysqli_query($conexao,"SELECT SUM(entrada) FROM livro"); I believe that it is because the values are comma (ex: 1,10), does anyone have any hint of what to do? Table: book, column: input.

  • And how’s the comma in the database? You stored a numeric value in a text column?

  • I put the value on varchar

  • Then, if possible, already refactoring the bank and store in a numerical column so that these problems do not happen.

  • Since it has commas I put in decimal, but it still returns me this: "Recoverable fatal error. Object of class mysqli_result could not be converted to string in C: xampp htdocs Apps book index.php" on line 2

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.