我有一个理论问题.
我发现在PHP文件中声明一个函数和在执行相同操作的数据库中创建存储过程之间没有任何区别.
为什么我要创建一个存储过程,例如,返回特定国家/地区的所有城市的列表,当我可以使用PHP 函数来查询数据库时,它将具有相同的结果?
在这种情况下使用存储过程有什么好处?或哪个更好?要在PHP中使用函数还是在数据库中使用存储过程?这两者有什么不同?
谢谢.
我知道这个问题之前已被问过数百次,而且我已经通过了这些问题,但那些问题无法解决我的问题:s
到目前为止这是我的代码
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js">
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script>
<link href="bootstrap/js/bootstrap.min.js" rel="stylesheet" media="screen">
<link href="bootstrap/js/bootstrap-modal.js" rel="stylesheet" media="screen">
<link href="bootstrap/js/bootstrap-transition.js" rel="stylesheet" media="screen">
Run Code Online (Sandbox Code Playgroud)
在体内,我有这个:
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
请注意,我在头部使用了一些其他库,因为我需要它们用于谷歌地图,我试图删除它们但仍然没有触发模态视图.
我有一个像这样的控制器:
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$this->view->myvar = "Hello";
}
}
Run Code Online (Sandbox Code Playgroud)
和index.phtml视图部分:
<html>
<head>
<title></title>
</head>
<body
<h1><?php echo $this->myvar; ?></h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
由于某种原因,我无法在视图上看到Hello字..并且错误是我得到的:警告:在C:\ xampp\htdocs\myZend\module\Application\src\Application\Controller中从空值创建默认对象第19行的IndexController.php
我可以看到在控制器中配置变量的东西是问题,但我不知道为什么,这是将值分配给变量的正确方法...我错过了别的吗?
ThNKS
我在服务器godaddy上使用codeigniter上传了我的web项目,我可以通过这个链接访问它http://izhi-ks.org/facelajm/blog
我为这个网站购买了一个新域名www.facelajm.com,我已将目录更新为/ facelajm,我收到了404 Page Not Found错误.
所以我的ftp看起来像这样:
在根目录中,我有另一个站点是joomla,在该目录中,我有一个名为facelajm的文件夹.
在codeigniter根目录中,我有一个像这样的.htaccess:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Run Code Online (Sandbox Code Playgroud)
我做错了什么,我只能通过输入www.facelajm.com来打开网站.事实上,如果我只创建一个新的index.php并打印你好世界...我怀疑htaccess或者可能是配置文件?
这里也是config.php:
$config['base_url'] = "";
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
Run Code Online (Sandbox Code Playgroud) 我在firebug中收到此错误:
SyntaxError: missing ) after argument list
Run Code Online (Sandbox Code Playgroud)
从这段代码:
table +=
'<tbody>'+
'<tr>'+
'<td>'+this.zona+'</td>' +
'<td>'+this.rruga+'<br/><div id="dialog-'+this.id+'" style= "margin-left:1px; width:340px; display:none;height:180px"></div></td>' +
'<td>'+this.dita+'</td>' +
'<td><img src="images/map.jpg" id = "mapicon" onClick="show(this.rruga, this.id);"></td>' +
'<tr>'+
'<tbody>';
Run Code Online (Sandbox Code Playgroud)
我不太确定)我的代码中缺少哪个括号.