且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过HREF链接更新MySQL表值

更新时间:2023-02-18 11:16:20

您是否只是想更新MySQL表中的值?


如果是这样,请查看 MySQL UPDATE 。否则,你能更简洁地解释一下吗?
Are you just trying to update the value in the MySQL table?

If so, check out MySQL UPDATE. Otherwise, could you explain a little more concisely?


这有点帮助,Markus。它现在更新了表值,但它只是让它从下到上激活。


我的意思是:


我的推荐书垂直显示如下:


---------------------------- ---------

|姓名:Mat |

|这个地方很棒! |

| |

|见证ID 1 |

---------------------------- --------


------------------------------ -------

|姓名:桑迪|

|这个地方是岩石! |

| |

|见证ID 2 |

---------------------------- --------


------------------------------ -------

|姓名:Liz |

|这个地方很酷。 |

| |

|推荐证书3 |

---------------------------- --------



我必须首先激活ID 3,然后激活ID 2,然后激活ID 1.我不能只选择一个来自要激活的列表。假设我想将ID 3和ID 2保留在挂起(活动= 0)并激活ID 1,我必须激活所有三个,然后从单独的页面取消激活ID 3和ID 2。 />

为什么会发生这种情况?
Well that helped a little bit, Markus. It now updates the table value, however it''s only letting it activate from bottom to top.

What I mean is this:

I have the testimonials displayed vertically like so:

-------------------------------------
| Name: Mat |
| this place is great! |
| |
|Testimonial ID 1 |
------------------------------------

-------------------------------------
| Name: Sandy |
| this place is rocks! |
| |
|Testimonial ID 2 |
------------------------------------

-------------------------------------
| Name: Liz |
| this place is cool. |
| |
|Testimonial ID 3 |
------------------------------------


I have to activate ID 3 first, then ID 2, then ID 1. I can''t just choose one from the list to activate. Let''s say I want to leave ID 3 and ID 2 in pending (active = 0) and activate ID 1, I''d have to activate all three and then unactivate ID 3 and ID 2 from a seperate page.

Why''s that happening?


你必须在URL字符串中传递ID ..


所以类似于:


< a href =" testimonialsindex.php?mode = activate& id = ID_OF _THE_RECORD">


然后,当您进行更新时,只更新该ID。
You have to pass the ID in the URL string..

So something like:

<a href="testimonialsindex.php?mode=activate&id=ID_OF _THE_RECORD">

Then when you do the update only update that ID.