草庐IT

not_matched

全部标签

php - Doctrine DQL 无效参数编号 : number of bound variables does not match number of tokens

我在这个查询中收到错误无效的参数编号:绑定(bind)变量的数量与标记的数量不匹配。我真的没有看到问题,有什么想法吗?publicfunctiongetByPartial($q,Company$company){$query=$this->createQueryBuilder('u')->join('u.company',':company')->where('u.firstNameLIKE:q')->orWhere('u.lastNameLIKE:q')->setParameters(array('company'=>$company,'q'=>'%'.$q.'%'))->getQu

php - Facebook API 范围 : Do NOT request users friend list

我建立了一个正在运行的facebook登录连接。但是,我通过连接收到以下消息:AppNamewouldliketoaccessyourpublicprofile,friendlistandemailaddress.我不知道,为什么facebook/我的应用程序想要获取好友列表。我想要的只是用户的邮件地址,所以我想跳过请求好友列表,这样用户就不会想知道我想要多少数据。我知道,我可以在参数范围内配置我请求的权限。目前我只有以下范围:https://www.facebook.com/dialog/oauth?client_id=".$app_id."&redirect_uri=".urlen

php - 错误 : Using $this when not in object context

这个问题在这里已经有了答案:PHPFatalerror:Using$thiswhennotinobjectcontext(9个回答)关闭9年前。我已经查找了涵盖此错误的其他问题,但找不到适用于我的问题的案例。基本上,我的类中的静态方法调用一个非静态方法,该方法反过来调用另一个非静态方法。这会引发fatalerror:Fatalerror:Using$thiswhennotinobjectcontextinclass.phponline...我不明白为什么不能通过$this从另一个非静态类方法调用一个非静态类方法。是因为它们都是从静态函数调用的,因此没有$this实例吗?这是(简化的)类

php - 未捕获的异常 'Swift_TransportException',消息为 'Connection could not be established with host smtp.gmail.com [Connection timed out #110]'

我已经在google中搜索过了,并尝试了StackOverflow中的所有建议。但我仍然收到fatalerror:我正在使用SwiftMailer向GMAIL发送和电子邮件。它在我的本地主机上完美运行,但是当我上传并尝试时它给了我一个fatalerror:这是我的部分代码:require_once'Swift-5.1.0/lib/swift_required.php';$email="fromemail@gmail.com";$transport=Swift_SmtpTransport::newInstance('ssl://smtp.gmail.com',465);$transpor

php - preg_match 的正则表达式

这个问题在这里已经有了答案:HowdoyouparseandprocessHTML/XMLinPHP?(31个答案)关闭7年前。我得到以下字符串:ElFTkSuQmCC"alt=""width="auto"height="auto"/>XX,X%并且想要“XX,X”,所以我构建了以下正则表达式:/QmCC"alt=""width="auto"height="auto"\/>\n(.*?)%/我在线测试了它并找到了XX,X的匹配项,但是当我尝试使用以下代码在php中执行它时preg_match_all('/REGEX/',$string,$match);不匹配。你有什么建议吗?字符串肯定

PHP - Preg_match 最短匹配

我正在尝试从此字符串中获取“内容”:$string="startstartcontentend";像这样使用preg_match:preg_match('/start(.*?)end/',$string,$matches);echo$match[1];但是,问题是$matches[1]返回startcontent而不仅仅是content因为有两个start在$string中(也许更多)如何使用preg_match只获取content部分? 最佳答案 使用否定前瞻:$string="startstartcontentend";preg

用于分割字符串的 PHP preg_match_all 正则表达式

任何人都可以帮助完成我的正则表达式吗?我的字符串格式如下:{p:19}Ja?DumöchtestzurKönigin?{p:20}Hmm...DubistgekommenumdenTitelKriegerinzuerhalten?Verstehe.DasistganzschöntapferfürsoeinejungeDame.DieKöniginwirdsicherauchsehrüberraschtsein.{t:19}Bittesehr,gehdirekthinein.{t:20}TreibeDichhiernichtherum,wennDuhiernichtszusuchenha

php - Uncaught Error : Class 'WP_Query' not found in url - Wordpress

我创建了一个在页面中传递ID的ajax文件。该页面有一个查询。我得到了一个错误。我想知道我的错误是什么,有些网站说我必须定义我的模板并需要wp-load.php,但有些网站说我必须在function.php上做。我真的不知道该怎么办。我是wordpresswoocommerce的新手。UncaughtError:Class'WP_Query'notfoundinxxxx/xxxx这是我的页面(get-fabric.php)'product','posts_per_page'=>1000,'product_cat'=>'fabric');$query=newWP_Query($args)

php - preg_match 或运算符

我的下面的代码产生了一个错误,未知修改的“|”...我正在尝试将它用作OR运算符。正确运行这段代码的方法是什么?$p="(\w+)|(\()|(\))|(\,)";$s="sum(blue,paper,green(yellow,4,toast)))";preg_match($p,$s,$matches);print_r($matches);编辑好吧,我稍微改了一下...~(\w+|\(|\)|,)~现在……问题来了:我需要获取该字符串并将其拆分成这样的数组:array("sum","(","blue","paper","green","("...等);有人可以帮我做吗?当我运行上面的表

php - Magento : Special price not displaying in the product page

我将特价规则应用于商店中的所有产品。一旦一切都结束了,特价就会显示在除产品页面(显示完整产品信息)之外的所有页面中。我正在使用自定义主题。我的自定义主题有问题吗? 最佳答案 如果您尝试重新应用您的目录规则并且特价再次出现,请确保您的cron作业已针对目录价格规则进行设置。 关于php-Magento:Specialpricenotdisplayingintheproductpage,我们在StackOverflow上找到一个类似的问题: https://sta