duankeng2026 2009-12-29 00:31
浏览 44
已采纳

用户注册重复链接的最佳方式(MYSQL + PHP)

so i have a page where a user can submit his own links

i dont want to make a script that do everything automatic, i just want to make a page where, when the .php find a possible duplicated link, i get a warning like "ID 22 could possible have the same link as ID 738"

i only need like the query to do that...if its possible with that..i can only use php and mysql

if its too expensive (memory, cpu..) i can make like a submit button then when pressed generates like a report

ps: just to be clear, im not showing the message to the user, is something im going to put at my admin cp..and its not comparing "link 1" to "link 2" but searching the entire database thanks

  • 写回答

2条回答 默认 最新

  • dongzong3053 2009-12-29 00:42
    关注

    Your best bet would be to have a query that runs when new links are submitted. It could do something like this as a basic example:

    SELECT * FROM links WHERE url = ""

    If that returns results, then you have a dupe which can either be prevented from being inserted into the database, or simply flagged somewhere for review.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备