首页 \ 问答 \ 类似的文字php mysql(Similar Text php mysql)

类似的文字php mysql(Similar Text php mysql)

我有以下代码,当我搜索一个单词时,它显示我是你的意思。 问题是,如果我输入“临床”,我希望它返回临床,但它返回“重新安排”

$my_word = $_POST['value'];
$bestMatch = array('word' = > $my_word, 'match' = > 2);
$result = mysql_query("SELECT keyword FROM athena");
$storeArray = Array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    similar_text($row['keyword'], $my_word, $percent);
    if ($percent > $bestMatch['match'])
       $bestMatch = array('word' = > $row['keyword'], 'match' = > $percent);
}
if ($bestMatch['match'] < 70)
   echo 'Did you mean: <strong>'.$bestMatch['word'].'</strong>';

i have the following code that when i search for a word it shows me a did you mean. the issue is if i type in "clin" i want it to return clinicals but it returns "reschedule"

$my_word = $_POST['value'];
$bestMatch = array('word' = > $my_word, 'match' = > 2);
$result = mysql_query("SELECT keyword FROM athena");
$storeArray = Array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    similar_text($row['keyword'], $my_word, $percent);
    if ($percent > $bestMatch['match'])
       $bestMatch = array('word' = > $row['keyword'], 'match' = > $percent);
}
if ($bestMatch['match'] < 70)
   echo 'Did you mean: <strong>'.$bestMatch['word'].'</strong>';

原文:https://stackoverflow.com/questions/11321376
更新时间:2022-03-10 19:03

最满意答案

对我来说,付款应该始终是用户的最后一个操作,如果出现其他任何问题,您不希望撤消付款。 因此,如果用户愿意,请让用户匿名浏览您的网站。 然后,当他想要买东西时,让他记录(如果他已经有账户)或注册(如果他没有账户),然后他可以在验证后处理PayPal付款。 您在提交帐户注册时会将其信息发送到数据库。 如果他的提交由于某种原因(缺少字段或其他)而失败,他将不得不再做一次,直到它工作。

不确定是否回答了你的问题。 当然,这对我来说似乎是最合乎逻辑的方式,但在某些情况下你可能想要以不同的方式做事(我现在看不到)


To me, payment should always be the last action of the user cause if anything else goes wrong, you don't want to have to undo the payment. So let the user navigate your website anonymously if he wants. Then, when he wants to buy something, ask him to log (if he already has an account) or register (if he does not have the account), and then he can process the payment on paypal once he is authenticated. You will send his information to the database when he submits his account registration. If his submissions fails for some reason (missing field or whatever), he will have to do again until it works.

Not sure that answers your question. Of course, that seems the most logical way to me, but there might be some cases where you want to do things differently (which I do not see right now)

相关问答

更多
  • 在网站付款偏好设置下的PayPal帐户个人资料中,您应该看到PayPal帐户可选的选项。 确保禁用此选项并且无帐户支付的选项应该消失。 I found the solution at x.com forums - the key directive for the Pay request is 'fundingConstraint' - https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_ap ...
  • Yahel的回答不正确:我打电话给PayPal,他们解释说为了接受非PayPal付款必须满足以下条件: 企业电子邮件地址必须确认。 您可以通过转到配置文件>电子邮件来检查。 PayPal账户可选必须选中: 转到www.paypal.com.au并登录到您的商户帐户。 点击页面右上角的“个人资料图标”(“注销”按钮旁边) 点击“配置文件和设置” 点击“我的销售工具”。 点击“网站偏好设置”旁边的“更新”。 选择页面底部附近的“PayPal帐户可选”下的“开”。 点击“保存”。 Yahel's answer i ...
  • 是的,你可以做到这一切。 http://www.tipsandtricks-hq.com/playing-in-paypals-sandbox-2880为您提供高速概览。 而https://cms.paypal.com/cms_content/TR/tr_TR/files/developer/PP_Sandbox_UserGuide.pdf是官方文档。 Yes, you can do all of that. http://www.tipsandtricks-hq.com/playing-in-paypal ...
  • 您可以访问www.paypal.com/buttonfactory为他们创建一个按钮,您只需要将他们与PayPal帐户关联的电子邮件地址链接到他们的帐户。 You may create a button for them by going to www.paypal.com/buttonfactory and all you will need is the email address they have associated with their PayPal account to link the bu ...
  • 是的,要实施安全令牌,您需要拥有带有付费流程链接或paylfow pro的管理帐户。 注册 您可以使用test运行经理帐户中的交易(类似于paypal中的沙箱) Yes, for implementing Secure token you need to have a manger account with payflow link or paylfow pro. Sign up You can run the transactions in manager account with test(simila ...
  • 我意识到我需要使用PaymentID并使用SDK来检索更详细的付款信息。 $ apiContext = $ this-> getApiContext(); $payment = new Payment(); $payment = $payment->get( $paymentId, $apiContext ); $execution = new PaymentExecution(); $execution->setPayerId( $_GET ...
  • 只有Express Checkout paypal api允许它... 查看paypal快速结账的文档 https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPGettingStarted 我不相信直接付款选项允许它。 Only the Express Checkout paypal api allows it... Check out the documentation for pa ...
  • 如果个人是指个人PayPal帐户,那么不,您将无法做到这一点。 您需要一个企业帐户才能访问大多数API,并且您需要PayPal Payments Pro才能访问DoDirectPayment。 PayPal Pro每月30美元,但是,如果您想直接与我联系讨论,我可以免费为您提供专业帐户。 If by individual you mean a Personal PayPal account, then no, you won't be able to do that. You'll need a busin ...
  • 对我来说,付款应该始终是用户的最后一个操作,如果出现其他任何问题,您不希望撤消付款。 因此,如果用户愿意,请让用户匿名浏览您的网站。 然后,当他想要买东西时,让他记录(如果他已经有账户)或注册(如果他没有账户),然后他可以在验证后处理PayPal付款。 您在提交帐户注册时会将其信息发送到数据库。 如果他的提交由于某种原因(缺少字段或其他)而失败,他将不得不再做一次,直到它工作。 不确定是否回答了你的问题。 当然,这对我来说似乎是最合乎逻辑的方式,但在某些情况下你可能想要以不同的方式做事(我现在看不到) To ...
  • 这种方式不是一个很好的解决方案,因为您无法检查或保证双方都拥有PayPal帐户。 我建议使用自适应付款(连锁付款)。 这将允许您作为PayPal帐户持有人运行每笔交易,它会将钱发送到相应的卖家PayPal帐户,或通过电子邮件发送给他们,让他们知道如果他们没有PayPal帐户他们有钱等,这样他们可以报名并领取这笔钱。 This way is not a great solution because you have no way to check or guarantee that both parties ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。