这是我试图用来存储客户端的IP地址的代码.我试图通过尝试在这个问题中看到的东西将ip地址存储到unsigned int:用于IP地址的MySQL数据类型是什么?
这是我的代码:
$client_ip = $_SERVER['REMOTE_ADDR'];
$ip_insert = "SELECT INET_ATON('$client_ip')";
$sql = "INSERT INTO rtv_sign_cispa (name_cispa,ip_cispa,email_cispa,message_cispa) VALUES ('$name','$ip_insert','$email','$message')";
Run Code Online (Sandbox Code Playgroud)
该语句中还有其他内容存储但只是忽略那些,它们有效,而不是IP地址.
错误:
错误:SQL语法中有错误; 查看与您的MySQL服务器版本对应的手册,以便在第1行'192.168.2.1''','email@email.com','Hmmmm')附近使用正确的语法
接近后的ip地址实际上显示了正确的IP,我当然只是出于安全原因将其切换到本地IP.email@email.com和Hmmm来自填写的表单以激活它,所以不要太介意.
有谁知道我做错了什么?我是SQL的新手.
我目前正在尝试制作一个与游戏服务器一起使用的小型Web应用程序.
Web应用程序应允许用户查看游戏项目的一系列产品/请求.产品和请求来自用户对网站的输入.
我的问题是什么是从这些用户输入存储数据然后使用这些存储的数据生成某种列表页面的最佳方法.
如果您需要一些细节,以下内容将解释用户输入字段的确切内容:
还有一个视图,例如人的用户名,提供/请求ID(可能只是像数据库中的自动递增字段).
考虑到我对存储信息和检索信息都很陌生,与存储信息的最佳(有效)方式相比,最简单的存储方式是什么?
我正在尝试恢复我从 pg_dump 创建的 SQL 文件,但是尝试将转储加载到新主机中,并且出现许多语法错误,如下所示:
psql:subscription_dump.sql:3741: ERROR: syntax error at or near "We"
LINE 1: We need to see if there's anything else needing
doing. ...
^
Run Code Online (Sandbox Code Playgroud)
它显示的是来自数据库的一些数据。为什么导入时数据库中的数据会导致语法错误?
psql "service=subscription_odyssey" -f subscription_dump.sql
Run Code Online (Sandbox Code Playgroud)
在对#postgressql 提出建议后,我将命令更改为以下内容:
psql "service=subscription_odyssey" -f subscription_dump.sql -v ON_ERROR_STOP=1
Run Code Online (Sandbox Code Playgroud)
这是现在第一个报告的错误:
psql "service=subscription_odyssey" -f subscription_dump.sql -v ON_ERROR_STOP=1
SET
psql:subscription_dump.sql:6: ERROR: unrecognized configuration parameter "lock_timeout"
Run Code Online (Sandbox Code Playgroud) 我一直在尝试升级我的软件包,但事情开始崩溃,我现在无法构建,也似乎无法找出问题所在。我怀疑问题与.babelrc
文件有关,因为它是抛出的babel-loader错误。
.babelrc
{
"presets": [
],
"plugins": [
[
"react-hot-loader/babel",
"transform-object-rest-spread"
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
],
"env": {
"start": {
"presets": [
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
在执行npm run build时出现堆栈错误跟踪:
ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: .plugins[0][1] must be an object, false, or undefined
at assertPluginItem (/var/www/FlaskApp/people-app-prod/static/node_modules/@babel/core/lib/config/validation/option-assertions.js:244:15)
at arr.forEach (/var/www/FlaskApp/people-app-prod/static/node_modules/@babel/core/lib/config/validation/option-assertions.js:222:30) …
Run Code Online (Sandbox Code Playgroud)