gpt4 book ai didi

mysql - 如何删除phpmyadmin中的数据库记录?

转载 作者:行者123 更新时间:2023-11-29 03:08:33 28 4
gpt4 key购买 nike

我是 VB.net、sql 甚至 phpmyadmin gui 的新手。我想删除保存在我的 phpmyadmin 中的记录,但是在执行 sqlcommand 的 executenonquery() 时出现错误

这是我在 VB.NET 中使用的代码:

Public Sub RetrieveInfos(ByRef SQLStatement As String)
Dim cmd As MySqlCommand = New MySqlCommand

With cmd
.CommandText = SQLStatement
.CommandType = CommandType.Text
.Connection = SQLConnection
.ExecuteNonQuery()

End With

'--read the records in database in phpmyadmin gui---
Dim myReader As MySqlDataReader = cmd.ExecuteReader

If myReader.Read Then
lblName.Text = myReader.GetString(0)
lblAge.Text = myReader.GetString(1)


End If

myReader.Close()
SQLConnection.Close()
MsgBox("Records Successfully Retrieved")
SQLConnection.Dispose()
End Sub
Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
Dim SQLStatement As String = "DELETE FROM patient WHERE 1"
RetrieveInfos(SQLStatement)
End Sub

如有任何帮助,我们将不胜感激。谢谢!

最佳答案

从 phpmyadmin 中删除数据,如 phpMyAdmin setting 中指定您需要在 config.inc.php 中进行编辑。

boolean $cfg['AllowUserDropDatabase'] (line 503)

show a 'Drop database' link to normal users

关于mysql - 如何删除phpmyadmin中的数据库记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11674410/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com