小编Ali*_*ami的帖子

单击按钮时更新数据库

我这里有一个按钮:

<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)

javascript php mysql ajax

5
推荐指数
1
解决办法
1622
查看次数

在指针列表上使用迭代器

我试图迭代一个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成员函数的类,它返回游戏的名称.我该怎么做才能编译?

c++ iterator list operator-precedence

4
推荐指数
3
解决办法
191
查看次数

Vulkan 构建错误

我想构建一个包含在 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 的属性?

vulkan

2
推荐指数
1
解决办法
4147
查看次数

标签 统计

ajax ×1

c++ ×1

iterator ×1

javascript ×1

list ×1

mysql ×1

operator-precedence ×1

php ×1

vulkan ×1