急关于多表和序列化的,请给我一些思路和方法
老大让我做一个频道管理~~~~~~~现在的基本流程是1.添加频道 - 添加标签 - 问题就在标签里面了,标签需要序列化,且存到数据库的是序列化后的ID 比如 ['2'=>'a']存这个2到数据库去 ,在添加数据库的同时还要判断另外一张标签表里面存在这个标签内容字段不. 我依靠自己的思路来做遇到的是这里..我存的是ID.我怎么根据ID判断标签存在不存在呢
$see_tag = [];
foreach ($tags as $k=>$v){
$see_tag[] = strval($v);
}
if (array_diff($see_tag,$tagval)){
self::output(['title'=>'标签不存在','type'=>'error']);
}
直接根据输入的内容和另外一张表的字段对比!恩 没问题. 可是在前台展示的时候 需要反序列化展示我正常的文本内容 但是结果他展示的是我ID.我怎么样才能根据存进去的ID获取ID后面没存进去的内容呢 且不会影响做修改动作?
回复讨论(解决方案)
现在就是前台不知道怎么根据ID现实后面的标签. 还要和另外一张表关联起来!
你存id的时候也把标签存到另外一个表啊,不然你这样去直接取肯定是不现实的。
另外,也可以把标签用rsa加密,加密成一个id存到数据库,然后取出来的时候进行解密就可以了。(这个方法不是特别好,因为会加重系统负载。)
老大让我这样做啊 他说可以的!....
版主..求帮忙啊!
既然是你们老大叫你这么做的,那你就去问你们老大该怎么写!
我们不会像你们老大那要想出这种变态的方案

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Alipay PHP...
