草庐IT

display_result

全部标签

php - Dbus PHP 无法在没有 $DISPLAY 的情况下为 X11 启动 dbus-daemon

我正在使用GREELabs'DbusPHPExtension在我尝试制作一个能够创建桌面通知的PHP类时。$dbus=$dbus=dbus_bus_get(DBUS_BUS_SESSION);$message=new\DBusMessage(DBUS_MESSAGE_TYPE_SIGNAL);$message->setDestination("org.freedesktop.DBus");$message->setAutoStart(true);$dbus->sendWithReplyAndBlock($message,1);当我的代码运行时出现以下错误:Warning:dbus_bu

php - 警告 : mysql_data_seek(): Offset 1 is invalid for MySQL result index 5 (or the query data is unbuffered)

请任何人提供帮助。我正在尝试执行以下php代码:$sql="SELECT*FROMvendorsWHEREvuid=".$uid."ANDstatus="."'c'";$sql=$sql."LIMIT0,10";$result=mysql_query($sql);$numrows=mysql_num_rows($result);for($i=0;$i0){mysql_data_seek($result,$i);}我收到以下错误警告:mysql_data_seek():偏移量1对于MySQL结果索引5无效(或查询数据未缓冲)。$numrows为2,因此mysql_data_seek的范围

php - 故障排除 "Warning: mysqli_result::fetch_array() expects parameter 1 to be long, object given"

我收到的警告是:Warning:mysqli_result::fetch_array()expectsparameter1tobelong,objectgivenin...line103.我在第103行旁边注释了while($row=$result->fetch_array($result)){问题2:我可以将其中的任何内容存储在包含文件中吗?问题3:对于$query,我可以将这些Buyer、Seller中的任何一个存储在某个数组中吗?怎么办?/*FETCHCONTACTINFORMATION*/$query=("SELECT*FROMcontactsWHEREcontacttypeI

php blowfish 哈希与 crypt() : the CLI result differs from webserver's one

当我使用使用Blowfish算法的php函数crypt()时withweb-server:我得到这个结果:$2a$10$7711cbpe58dfpogiu0498u5Vh773A3qx.3LE3ro3NX7F9c9N7.pOm但是如果我使用PHP解释器命令行:php-r"echocrypt('SAD123',sprintf('$2a$10$%s','7711cbpe58dfpogiu049857f011werb0'));"我得到另一个结果:a0SqNHxQ8/2mA你有什么想法吗?系统是:Apache/2.2.3(CentOS),PHP版本5.4.26 最佳

php - 拉维尔 5 : Replace string in query results (Eloquent ORM)

是否可以返回表中的所有列,但如果字符串(值)包含特定单词,则删除该单词?比如我有这样一张表:-------------------------------------------------|id|article_desc|article_link|active||----|------------------|----------------|--------||1|Hello,world!|http://test.co|0||2|ReplaceWordTest|http://null.org|1|-------------------------------------------

php - 防止调用 error_reporting() 和/或 ini_set ('display_errors' , 'On' ) 覆盖 php.ini 设置

我的php.ini文件中有这个设置:error_reporting=E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR但我仍然每分钟在错误日志中收到数以千计的通知和警告条目。我当然意识到我会更好地处理这些错误,但这不是我的代码,我也不会为此付费,我只需要摆脱那些肥胖的error_log文件(每天Gbs)。我搜索了代码并删除了所有error_reporting()调用,这样就成功了,但是,有没有办法禁止error_reporting()覆盖php.ini?ini设置?我是否也可以防止对ini_set('display_errors')的调用覆盖php

php - Magento _ $weee Helper->type Of Display() 方法

我正在调查Magento臭名昭著的价格block/price.phtml文件,我遇到了一些看起来像错误和/或废弃代码路径的东西,但我想运行它首先由社区确保我了解正在发生的事情。在整个文件中,Magento将在条件调用中使用以下方法$_weeeHelper->typeOfDisplay($_product,0)$_weeeHelper->typeOfDisplay($_product,1)$_weeeHelper->typeOfDisplay($_product,4)$_weeeHelper->typeOfDisplay($_product,2)根据我的代码跟踪收集到的信息,此方法(称为

php - 在 CodeIgniter 中跳过 csv_from_result() 中的第一行

我正在尝试使用CodeIgniter中的csv_from_result()将仅包含两个字段id、email的简单表格导出到CSV文件.生成的CSV文件的第一行包含列的名称,但我只想要数据。有什么办法可以跳过第一行吗?这是我的代码:$query=$this->EE->db->query("SELECTemailFROMexp_sct_mailing_list");$this->EE->load->dbutil();$data=$this->EE->dbutil->csv_from_result($query,",","\r\n");$this->EE->load->helper('dow

php - 拉维尔 5.2 :How to display time like this?

我正在使用Laravel5.2,我想这样显示文章的创建时间:created_atdisplayingin1daytoday2-10days(2-10)daysago>10daysshowcreationdatedirectly怎么做?提前致谢!编辑:Controller:publicfunctionshow($id){$article=Article::findOrFail($id);returnview('show',compact('article'));}查看:{{$article->title}}{{$article->content}}{{$article->created_

php - 是否安全 :cipher encrypted result depend on the server?

我在一个cakephp应用程序中工作,我在其中使用Security::cipher来加密一些数据。它工作得很好,但我已经将文件和数据库移动到另一台服务器,现在加密结果不同了。我试过一些简单的线条:$security=newSecurity;$code=$security->cipher('1234',Configure::read('Security.cipherSeed'));当我打印$code时,两个服务器中的值不同。我在两个core.php文件中配置了相同的Security.cipherSeed。Security::cipher函数是否使用某些服务器值进行加密?谢谢。