我的PHP表单中的数据库中未执行编辑和删除操作 [英] Edit and delete aren't executing in the database in my PHP form

查看:41
本文介绍了我的PHP表单中的数据库中未执行编辑和删除操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

spcmaoscnja sc sa’dl vas dv; kas kjas dk s d kfjsdf; k sd; kjf ojd aojsd ajs d;作为cc; kjajs d; kas

spcmaoscnja sc sa'dl vas dv;kas kjas dk s d kfjsdf;k sd;kjf ojd aojsd ajs d; as cc ;kjajs d; kas

推荐答案

您已在 mysql_connect()中使用了代码。如果您的PHP版本为7或更高版本,则由于已弃用,因此将不起作用(将适用于5.5和5.6版本,但会出现警告)。

You have used mysql_connect() in the update clause of the code. If your PHP version is 7 and above it will not work (will work for 5.5 and 5.6 versions but with a warning) as it is deprecated.


警告

Warning

此扩展在PHP 5.5.0中已弃用,在PHP
7.0.0中已删除。相反,应使用MySQLi或PDO_MySQL扩展。另请参阅MySQL:选择API指南和相关的FAQ,以获取更多
信息。此功能的替代方案包括:

This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

mysqli_connect()
PDO::__construct()


了解更多这里

在编辑时,我看不出在建立新连接时的意义在脚本开头建立了数据库连接。使用与从脚本向数据库中插入数据相同的函数:

I don't see the point in establishing a new connection while editing when there is a database connection that was made in the beginning of the script. Use the same functions used to insert data to the database from your script:

$db->query("UPDATE tablename SET column_name = value");
// to check no. of rows affected by the previous query 
$db->affected_rows()

这篇关于我的PHP表单中的数据库中未执行编辑和删除操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆