如果我使用where子句,没有插入数据的where子句,我有一个不插入的查询.这很奇怪,我在WAMP之前从未见过它
$key=substr(md5(rand(0, 1000000)), 0, 5);
$key1="INSERT INTO login(key_id) VALUES('$key')
WHERE (email_id = '" . mysql_real_escape_string($_POST['email_id']) . "')"
if(mysql_query($key1))
{
$message = 'User Added!.';
echo "<SCRIPT>
alert('$message');
location='forgotpassword.php';
</SCRIPT>";
}
Run Code Online (Sandbox Code Playgroud)
如果我回显$_POST['email_id']它确实返回有效结果
我有下拉选项在 li 中。我想动态删除具有特定 id 的 li。结构如下
<ul class="es-list" style="top: 305.483px; left: 191.25px; width: 194px; display: block;">
<li id="from_7" class="" value="7" style="display: block;">Adelaide</li>
<li id="from_1" class="" value="1" style="display: block;">Alexandria</li>
<li id="from_17" class="" value="17" style="display: block;">Antwerp</li>
<li id="from_19" value="19" style="display: block;">Aqaba</li>
Run Code Online (Sandbox Code Playgroud)
我试过
$('#from_7').remove();
Run Code Online (Sandbox Code Playgroud)
但它并没有删除 li
我是 codeigniter 的新手,我已经完成了以下代码
public function members($limit, $offset)
{
$this->load->model('Management/Member_model', 'member');
$this->db->reset_query();
$this->db->select('*');
$this->db->from($this->member->table);
$this->db->join('ib_communities_dtl','ib_communities_dtl.dtl_user_id='.$this->member->table.'.user_id','inner');
$this->db->join('ib_communities','ib_communities_dtl.dtl_community_id=ib_communities.community_id','inner');
$this->db->where('ib_communities.community_id', $this->community_id);
return $this->db->get()->result('Member_model');
}
Run Code Online (Sandbox Code Playgroud)
我想为上述查询添加偏移量和限制,任何人都可以帮我修改它来实现这一点吗?
提前致谢
我有功能frm_trigger_entry_update这是在后台运行的PHP功能我的意思是这是一个ajax PHP功能.
在这个函数中,我已经编写了一些jquery或javascript函数,这将是alert一些文本消息.
在下面的代码片段中,您可以看到我的功能代码.
<?php
function frm_trigger_entry_update($atts)
{
//here i have some php code which run properly
}
?>
Run Code Online (Sandbox Code Playgroud)
我已经尝试了下面的代码片段,但它对我来说不起作用意味着在调用此函数后警报框没有显示.
<?php
function frm_trigger_entry_update($atts)
{
//here i have some php code which run properly
?>
<script>
jQuery(document).ready(function($){
alert("my message");
});
</script>
<?php
}
?>
Run Code Online (Sandbox Code Playgroud)
那么如何在这个PHP函数中提醒任何人有任何想法.
我有这些代码,
$end = strtotime ('last day of previous month') ;
$start = strtotime ("-1 year +1 day", $end) ;
$new ['first'] = date ('Y-m-d',$start) ;
$new ['last'] = date ('Y-m-d',$end) ;
$interval = DateInterval::createFromDateString ('1 month') ;
$period = new DatePeriod($start, $interval, $end) ;
foreach ($periods as $period) {
print_r($period -> date_format('Y-m')) ; echo "<br>";
}
Run Code Online (Sandbox Code Playgroud)
但是,我已通过此消息返回:
遇到未捕获的异常
类型:异常
消息:DatePeriod::__construct():此构造函数接受 (DateTimeInterface、DateInterval、int) 或 (DateTimeInterface、DateInterval、DateTime) 或 (字符串) 作为参数。
有人可以帮助我吗?
如果由于 php 引擎无法解析 html 代码,我们无法在 php 中使用 html 代码,那么为什么我们可以在 php 标签中包含一个开放式(没有关闭 html 标签)的 html 脚本?
我尝试用包含文件的裸内容替换 include 调用,但这会触发意外的文件结束错误(这是有道理的,因为 php 无法解析 html)。
注册.php:
<?php
$page_title = 'Register';
// the following script echoes $page_title as title, links to stylesheet, and opens body
include ('includes/header.html');
Run Code Online (Sandbox Code Playgroud)
头文件.html:
<!DOCTYPE HTML>
<html lang = "en">
<head>
<meta charset="UTF-8">
<title> <?php echo $page_title ; ?> </title>
<link rel = "stylesheet" href="includes/style.css">
</head>
<body>
<header> <h1>Page Header</h1></header>
Run Code Online (Sandbox Code Playgroud)
我期望以下之间的一致性:
a)包含('includes/header.html')
和
b)只需插入 header.html 代码。
来自b) 的 …
php ×5
html ×2
javascript ×2
mysql ×2
ajax ×1
codeigniter ×1
date ×1
insert ×1
intervals ×1
jquery ×1