我在SQL查询中遇到问题,需要一些帮助.
我是Php和sql的新手.所以任何帮助都会受到重视.
我有以下Sql查询并尝试.
$insert_on_duplicate_update_query = "INSERT INTO test (`store_client_id`,`customer_id`,`first_name`,`last_name`,`email`,`created_on`,`updated_on`,dob) VALUES('1','123','abc','xyz','abc@hotmail.com','2018-10-12 00:00:02','2018-10-12 00:00:02','NULL') ON DUPLICATE KEY UPDATE `store_client_id`='1',`customer_id`='123',`first_name`='abc',`last_name`='xyz',`email`='abc@hotmail.com',`updated_on`='2018-10-12 00:00:02',dob='null';";
$insert_on_duplicate_update_query = str_replace(array("'NULL'","'null'"), null, $insert_on_duplicate_update_query);
echo $insert_on_duplicate_update_query;
Run Code Online (Sandbox Code Playgroud)
所以在这里我想在后面的地方将'NULL'替换为NULL -
VALUES('1','123','abc','xyz','abc@hotmail.com','2018-10-12 00:00:02','2018-10-12 00:00:02','NULL')
Run Code Online (Sandbox Code Playgroud) 我使用的代码如下:
if (window.history && window.history.pushState) {
window.history.pushState('forward', null, './#forward');
$(window).on('popstate', function () {
window.location.href = "https://www.google.com/";
});
}
Run Code Online (Sandbox Code Playgroud)
我想使用“推送状态”在 URL 中添加 #forward,然后如果用户单击浏览器后退按钮,我想重定向到另一个链接。
工作:它在 chrome 中工作,但不能与“CANARY”搜索引擎一起工作。请帮我弄清楚这个问题。提前致谢。