简体   繁体   English

更改MYSQL INT值

[英]Change MYSQL INT Value

I'm real new to MySQL I've managed to create a table called maintenance with a default int value of 0 and I am trying to create a button which will change this value to one. 我是MySQL的新手,我设法创建了一个名为maintenance的表,其默认int值为0,并且我试图创建一个将其更改为1的按钮。

Here is a screenshot of what I have in phpmyadmin I just need to find some php code which will change the value to one I have tried many things but none have worked! 这是我在phpmyadmin中拥有的屏幕截图,我只需要找到一些php代码即可将值更改为一个,我尝试了很多事情,但没有任何效果!

图片

Just for your information it will be used so that when the value is 1 the maintenance page will be shown 仅供参考,将使用该值,以便当值为1时将显示维护页面

Ok, what you have here is an empty table, with a row for status. 好的,这里是一个空表,上面有一行状态。

First, you need to insert the status row you have just created. 首先,您需要插入刚刚创建的状态行。 Either do this through PHPMyAdmin (click insert at the top), or use the following SQL 通过PHPMyAdmin(单击顶部的插入)执行此操作,或使用以下SQL

INSERT INTO gfx_maintenance(status) VALUES(0)

Now, you actually have some data in the DB. 现在,您实际上在数据库中有一些数据。 To change this, either click the little pencil that appears in PHPMyAdmin, or use the following SQL: 要更改此设置,请单击PHPMyAdmin中出现的小铅笔,或使用以下SQL:

UPDATE gfx_maintenance SET status=1

Hope this helps. 希望这可以帮助。

检查表并转到更改选项,您将找到默认选项,然后选择作为定义选项,输入所需值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM