Sobrepor valor no banco de dados
Estou criando um sistema simples de depósito porém estou tendo um problema. Sempre q faço um novo depósito, ao invés de sobrepor o antigo, cria se um novo valor no banco de dados:
<?php
$dep = $_POST['depositar']. $conn = mysql_connect('localhost', 'root', '123' ). $db = mysql_select_db('test'). $query_select = "SELECT depositar FROM dinheiro WHERE depositar = '$dep'". $select = mysql_query($query_select, $conn). $array = mysql_fetch_array($select). $saldo = $array['depositar']. $query = "INSERT INTO dinheiro (depositar) values ('$saldo' + '$dep')". $inset = mysql_query($query, $conn).?> no banco de dados está apresentando os valores assim: [/applications/core/interface/imageproxy/imageproxy.php?img=http://127.0.0.1/home/mysql/themes/original/img/s_fulltext.png&key=468b83a073fff5a472149cd8b51648d9861d6ae972e920f416a6f22f9c81f91b" title="Textos completos" width="50" alt="s_fulltext.png" />](http://127.0.0.1/home/mysql/sql.php?db=test&table=dinheiro&token=047372fc7447bfb56ddbc4f1e070cfd8&sql_query=SELECT+%2A+FROM+%60dinheiro%60&session_max_rows=30&pos=0&disp_direction=horizontal&repeat_cells=100&goto=tbl_properties_structure.php&dontlimitchars=1)[deposita](http://127.0.0.1/home/mysql/sql.php?db=test&table=dinheiro&token=047372fc7447bfb56ddbc4f1e070cfd8&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=SELECT+%2AFROM+%60dinheiro%60++ORDER+BY+%60dinheiro%60.%60depositar%60+ASC)r[/applications/core/interface/imageproxy/imageproxy.php?img=http://127.0.0.1/home/mysql/themes/original/img/b_drop.png&key=1cf108100bab3120f1ec78ed68cd5d8049423d228e808e7ef429bff682430a9c" title="Remover" width="16" alt="b_drop.png" />](http://127.0.0.1/home/mysql/sql.php?db=test&table=dinheiro&token=047372fc7447bfb56ddbc4f1e070cfd8&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=DELETE+FROM+%60dinheiro%60+WHERE+CONVERT%28%60dinheiro%60.%60depositar%60+USING+utf8%29+%3D+%2710%27+LIMIT+1&zero_rows=Registro+eliminado&goto=sql.php%3Fdb%3Dtest%26table%3Ddinheiro%26token%3D047372fc7447bfb56ddbc4f1e070cfd8%26pos%3D0%26session_max_rows%3D30%26disp_direction%3Dhorizontal%26repeat_cells%3D100%26dontlimitchars%3D0%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560dinheiro%2560%26zero_rows%3DRegistro%2Beliminado%26goto%3Dtbl_properties_structure.php)10 [/applications/core/interface/imageproxy/imageproxy.php?img=http://127.0.0.1/home/mysql/themes/original/img/b_edit.png&key=76dc23b0a24e78cc39259e56176720c78e03d3dc0f31dfc49d85a4ad5739ea41" title="Editar" width="16" alt="b_edit.png" />](http://127.0.0.1/home/mysql/tbl_change.php?db=test&table=dinheiro&token=047372fc7447bfb56ddbc4f1e070cfd8&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&primary_key=+CONVERT%28%60dinheiro%60.%60depositar%60+USING+utf8%29+%3D+%2720%27&sql_query=SELECT+%2A+FROM+%60dinheiro%60&goto=sql.php)[/applications/core/interface/imageproxy/imageproxy.php?img=http://127.0.0.1/home/mysql/themes/original/img/b_drop.png&key=1cf108100bab3120f1ec78ed68cd5d8049423d228e808e7ef429bff682430a9c" title="Remover" width="16" alt="b_drop.png" />](http://127.0.0.1/home/mysql/sql.php?db=test&table=dinheiro&token=047372fc7447bfb56ddbc4f1e070cfd8&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=DELETE+FROM+%60dinheiro%60+WHERE+CONVERT%28%60dinheiro%60.%60depositar%60+USING+utf8%29+%3D+%2720%27+LIMIT+1&zero_rows=Registro+eliminado&goto=sql.php%3Fdb%3Dtest%26table%3Ddinheiro%26token%3D047372fc7447bfb56ddbc4f1e070cfd8%26pos%3D0%26session_max_rows%3D30%26disp_direction%3Dhorizontal%26repeat_cells%3D100%26dontlimitchars%3D0%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560dinheiro%2560%26zero_rows%3DRegistro%2Beliminado%26goto%3Dtbl_properties_structure.php)20Discussão (4)
Carregando comentários...