我在PHP页面中有一个表.这是发票.所以我想在添加项目后打印它,我已经完成了编码部分,所有的东西都正常工作.
现在我只想按一个按钮将该发票表打印到纸上.我在Google上搜索过,但没有发现这样做的线索.
谁能帮我?
这是我右手边的桌子.它由左侧的表格填充,所以我只想打印右侧的表格:
我使用codeigniter创建了一个包含管理区域和用户区域的站点.但管理员和用户都无法同时登录.因为会话user_data只能使用一次.那我怎么能保存另一个会话数据呢?
这就是我保存管理数据的方式.
private function access_granted(){
$admin_session_data = array(
'username' => $this->input->post('username'),
'is_admin_logged_in' => 1
);
$this->session->set_userdata($admin_session_data);
$this->session->set_flashdata('successed', 'You Logged in Successfully');
$this->login_failed_or_successed();
}
Run Code Online (Sandbox Code Playgroud) 我的代码是
$user_query = '
UPDATE
users
SET
`password`="$password",
`email`="$email",
`position`="$position",
WHERE
`username`=".$uname."';
$user_result = mysql_query($user_query, $connection);
confirm_query($user_result);
Run Code Online (Sandbox Code Playgroud)
当我运行此查询时,它给我一个错误:
数据库查询失败:您的SQL语法中有错误;
检查与MySQL服务器版本对应的手册,以便在'WHEREusername=" 附近使用正确的语法.$ uname."'在第7行
任何人都可以帮我解决这个错误吗?
我有一个数据库表,该表有6行.我想要的是使用3列和2行表在html页面中显示6行.
我知道如何使用php数组和while循环.我的问题是如何限制数组在第一行放置3个项目,并将另外3个项目放在下一行.
这是我尝试但没有奏效的
<div id="maincontent">
<!-- class one -->
<?php
$getSection = getSection();
$i=0;
while($allSection = mysql_fetch_array($getSection)){
?>
<div class="subconent">
<table width="937" border="0">
<tr>
<td>
<div class="sub_image">
<a href="section.php?id=<?php echo urlencode($allSection['id']); ?>"><img src="admin/uploads/fron_sect/<?php echo $allSection['image']; ?>" width="134" height="120" border="0" alt="HNA" class="PopBoxImageLink" onmouseover="PopEx(this,-50,-25,205,186,20,null);" onclick="window.location='http://localhost/hants/section.php?id=<?php echo urlencode($allSection['id']); ?>'" /></a>
</div>
<div class="cont_txt">
<h3><?php echo $allSection['name_full']; ?></h3>
<p><?php echo substr($allSection['description'],0,140) . ""; ?></p>
<br />
<a href="section.php?id=<?php echo urlencode($allSection['id']); $i++; ?>"><img src="images/read_more.jpg" alt="Read More" width="89" height="25" border="0" /></a>
</div>
</td>
</tr>
</table>
</div> …Run Code Online (Sandbox Code Playgroud) 这是我的场景的示例代码.我有一些元素使用来自MYSQL表的PHP在容器div中加载.
<div id="itemContainer">
<div class="item">
test
</div>
<div class="item">
test
</div>
<div class="item">
test
</div>
<div class="item">
test
</div>
<div class="item">
test
</div>
<div class="item">
test
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
所以他们可能是10或12件物品,但我只需要同时展出4件物品.所以我试着在第四个项目之后选择所有项目.我尝试的方式有一些问题,所以我需要你的帮助.
$(document).ready(function() {
var items = $('#weekly_best_selling').children('.itemContainer').length;
if (items > 6) {
$('#weekly_best_selling').children('.itemContainer').nextAll('.itemContainer').css( "background-color", "red" );
}
});
Run Code Online (Sandbox Code Playgroud)
我对 Laravel 和学说完全陌生,一开始我选择 Laravel 6 并阅读了一些教程。正如我所见,将 Doctrine 与 Laravel 一起使用会更好,然后我尝试将 Doctrine 安装到我的项目中,但不幸的是,它失败了。
是不是因为 Laravel 6 是新的并且还不支持 Doctrine?或者我做错了什么?
我在作曲家上试过这个命令
composer require "laravel-doctrine/orm:1.3.*"
Run Code Online (Sandbox Code Playgroud)
它给了我一些错误,例如
然后,我尝试遵循 6.x 版的 Laravel 文档,并在数据库部分发现它提到在修改列之前安装学说/dbal
在修改一个列之前,一定要添加到你的 composer.json 文件中的 dotric/dbal 依赖。Doctrine DBAL 库用于确定列的当前状态并创建对列进行指定调整所需的 SQL 查询:
作曲家需要学说/dbal
但是,这个命令也会导致我出现同样的错误。
请指导我走正确的道路。谢谢你。
php ×5
html ×2
javascript ×2
arrays ×1
codeigniter ×1
css ×1
doctrine ×1
doctrine-orm ×1
html-table ×1
jquery ×1
laravel ×1
laravel-6 ×1
mysql ×1
session ×1
sql ×1
while-loop ×1