Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within PHP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
PHP
Delete error
Gil Carvalho
Ranch Hand
Posts: 80
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I have this function in php file
function verAtividadesDocente() { if(!$this->DBLogin()) { $this->HandleError("Erro na ligação à Base de Dados!"); return false; } $image = $iduser = $this->UserId(); $nresult = mysql_query("SELECT t1.idatividade, t1.atividade, t1.data, t1.hora, t1.local,t2.nome FROM atividades t1, utilizador t2 WHERE t2.idutilizador = '$iduser'", $this->connection) or die(mysql_error()); $num_rows = mysql_num_rows($nresult); echo "<table>"; echo "<tr> <td>Nome</td> <td>Data</td> <td>Hora</td> <td>Local</td> <td>Intervenientes</td> <td>Operações</td> </tr>"; while($row = mysql_fetch_assoc($nresult)) { echo "<tr>"; $id = $row['idatividade']; echo "<td>".$row['atividade']."</td>"; echo "<td>".$row['data']."</td>"; echo "<td>".$row['hora']."</td>"; echo "<td>".$row['local']."</td>"; echo "<td>".$row['nome']."</td>"; echo "<td>".'<a href="editaAtividade.php?id=',$id,'"><img src="images/tick.png"></a>'.' / '.'<a href="' . $this->removerAtividade($id) . '";><img src="images/delete.png"></a>'."</td>"; echo "</tr>"; } echo "</table>"; }
in this line
echo "<td>".'<a href="editaAtividade.php?id=',$id,'"><img src="images/tick.png"></a>'.' / '.'<a href="' . $this->removerAtividade($id) . '";><img src="images/delete.png"></a>'."</td>";
the removerAtividade($id) remove the id after i use refresh button...why?
function removerAtividade($id) { $nresult = mysql_query("Delete FROM atividades WHERE idatividade = '$id'", $this->connection) or die(mysql_error()); }
Any suggestion?
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Using a Variable with AJAX
Passing values between PHP pages without navigation
Javascript and PHP
get value on click from table using javascript
Difference between mysql_fetch_array() and mysql_fetch_row()
More...