Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php DDBB结构,以便我可以管理播放列表-当前、上一个、下一个_Php_Mysql_Sql_Database Design_Database Schema - Fatal编程技术网

Php DDBB结构,以便我可以管理播放列表-当前、上一个、下一个

Php DDBB结构,以便我可以管理播放列表-当前、上一个、下一个,php,mysql,sql,database-design,database-schema,Php,Mysql,Sql,Database Design,Database Schema,目前我有: Table playlist (id, name, id_user,many_items,last_item_used,...) table playlist_map (id, id_user, id_item,position...) 我想知道,这是否足以让用户从播放列表中添加/删除项目,并从播放列表中加载上一个和下一个项目 或者我应该改变我的计划?(我已经完成了50%的PHP,仍然没有问题,但我有一种感觉……) 提前感谢:p 我已经完成了播放列表的插入/编辑/删除,现在我可以

目前我有:

Table playlist (id, name, id_user,many_items,last_item_used,...)

table playlist_map (id, id_user, id_item,position...)
我想知道,这是否足以让用户从播放列表中添加/删除项目,并从播放列表中加载上一个和下一个项目

或者我应该改变我的计划?(我已经完成了50%的PHP,仍然没有问题,但我有一种感觉……)

提前感谢:p

我已经完成了播放列表的插入/编辑/删除,现在我可以:

class playlist_item{

    protected $id;
    protected $id_item;
    protected $nombre;
    protected $url;
    protected $id_playlist;
    protected $position;


     function __construct($id) {



    }

    function get_what($what){
        if($what == 'next'){

        }else if($what == 'prev'){

        }else if($what == 'last'){

        }else if($what == 'first'){

        }else if($what == 'current'){

        }

    }




}

我想你有一个班级播放列表,在那里你做了插入/编辑/删除。那么,为什么要在类playlist\u项中编写get\u what方法呢。把它放在你的班级播放列表上会更好吗?(因为,我还假设,您的意图是get\u what方法返回一个playlist\u item对象实例)。

通过编写以下内容。。。。嗯。。在playlist_map中排序,对吗?实际上我的目的是获取播放列表中的位置和对象的id。已经解决了这个问题。但我不记得我是不是在问题之后做的,我会检查;)我也认为这个答案应该是正确的;它实际上并没有回答:)