我这里有一个按钮:
<button type="button" class="btn btn-primary">add me</button>
Run Code Online (Sandbox Code Playgroud)
我尝试使用AJAX;在我的数据库中,我有一个sp_status
(在我的数据库中$UserData
是一个数组)。我想将sp_status
数据库中 id 值$UserData['sp_id']
从 5 更改为 0 的用户。以下是我尝试使用它执行此操作的代码:
<script>
$(document).ready(function(){
$(".btn").click(function(){
alert("PROBLEM IS HERE!");
$.ajax({
url: "update.php",
type: "POST",
data: {uid: $UserData['sp_id']}, //this sends the user-id to php as a post variable, in php it can be accessed as $_POST['uid']
success: function(data){
data = JSON.parse(data);
}
});
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
该$UserData
数组具有sp_id
用户的标识符。在同一文件夹中update.php
我编写了以下代码:
<?php
if(isset($_POST['uid'])){
$query = mysql("UPDATE `signup_participant` SET sp_status = 0 …
Run Code Online (Sandbox Code Playgroud) 我试图迭代一个list
指针:
int main () {
list<Game*> Games;
Games = build_list_from_file(); //Reading the games.info file
list<Game*>::iterator it = Games.begin();
it++;
cout << *it->get_name() << endl ;
// ...
}
Run Code Online (Sandbox Code Playgroud)
当我编译它时,我有这个错误:
error: request for member ‘get_name’ in ‘* it.std::_List_iterator<_Tp>::operator-><Game*>()’, which is of pointer type ‘Game*’ (maybe you meant to use ‘->’ ?)
cout << *it->get_name() << endl ;
^
Run Code Online (Sandbox Code Playgroud)
Game
是一个具有get_name
成员函数的类,它返回游戏的名称.我该怎么做才能编译?
我想构建一个包含在 Vulkan SDK 中的示例。
我从http://vulkan.lunarg.com下载了 SDK并安装了它。
然后我打开Visual Studio(我有一个2013版本),我从这个路径打开解决方案:(C:\VulkanSDK\1.0.13.0\Demos
)。我选择DEMOS.sln
文件。然后当我单击LocalWindowsDebugger
此消息时弹出:
vkCreateInstance Failure:
vkEnumerateInstanceExtensionProperties failed to find the VK_KHR_surface extention.
Do you have a compatible Vulkan installable client driver (ICD) insatalled? Please look at the Getting Started guide for additional information.
Run Code Online (Sandbox Code Playgroud)
我从未与 vulkan 合作过,但正如它命名为“Demo”一样,我认为它里面的所有东西都应该设置好才能工作。
我搜索了网络,但由于它是新的,因此很少有资源讨论它。
什么是ICD?以及如何安装它?(它与 VulkanSDK 的安装程序不同吗?)或者这个错误是关于完全不同的属性?喜欢设置 VisualStudio 的属性?