Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class packageInq {
- public $package;
- public $packageId;
- public $mysqli;
- function __construct(){
- $mysqli = new mysqli('localhost', 'modpack', '*******', 'modpack');
- }
- function getPackage($pId, $argTyp=TRUE, $arg=NULL, $arg2Typ=TRUE, $arg2=NULL, $arg3Typ=TRUE, $arg3=NULL){
- $packageId = $pId;
- if ($argTyp){
- $query = "SELECT id, language, clientVersion, needExamination, title, description
- FROM localisation
- WHERE packageId = ?";
- echo $pId;
- $result = $mysqli -> prepare($query);
- $result -> bind_param('s', $packageId);
- echo 'testObjekt';
- } elseif ($arg2Typ) {
- $query = "SELECT id, language, clientVersion, needExamination, title, description
- FROM localisation
- WHERE packageId = ?
- AND ? = ?";
- $result = $mysqli->prepare($query);
- $result -> bind_param('sss', $packageId, $argType, $arg);
- }elseif ($arg3Typ) {
- $query = "SELECT id, language, clientVersion, needExamination, title, description
- FROM localisation
- WHERE packageId = ?
- AND ? = ?
- AND ? = ?";
- $result = $mysqli->prepare($query);
- $result -> bind_param('sssss', $packageId, $argType, $arg, $arg2Type, $arg2);
- }else {
- $query = "SELECT id, language, clientVersion, needExamination, title, description
- FROM localisation
- WHERE packageId = ?
- AND ? = ?
- AND ? = ?
- AND ? = ?";
- $result = $mysqli->prepare($query);
- $result -> bind_param('sssssss', $packageId, $argType, $arg, $arg2Type, $arg2, $arg3Type, $arg3);
- }
- $result -> execute();
- $result -> bind_result($package['id'], $package['language'], $package['clientVersion'], $package['needExamination'], $package['title'], $package['description'] );
- $result -> fetch();
- $result -> close();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement