当前位置: 首页>>代码示例>>PHP>>正文


PHP prepareIdOut函数代码示例

本文整理汇总了PHP中prepareIdOut函数的典型用法代码示例。如果您正苦于以下问题:PHP prepareIdOut函数的具体用法?PHP prepareIdOut怎么用?PHP prepareIdOut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了prepareIdOut函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepareIdIn

 $road_map_id = prepareIdIn($road_map_id, $host);
 $road_map_id = mysql_real_escape_string($road_map_id);
 $ReturnObject = array();
 $Query = "SELECT * FROM road_map WHERE road_map_id = " . $road_map_id;
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $road_map_id = $Database['road_map_id'];
     $title = $Database['title'];
     $image = $Database['image'];
     $header = $Database['header'];
     $footer = $Database['footer'];
     $KeysQuery = "SELECT * from keys k";
     $KeysQuery .= " WHERE road_map_id = " . $road_map_id;
     $KeysQuery .= " ORDER BY name ASC";
     $KeysResults = mysql_query($KeysQuery) or die('Query failed: ' . mysql_error());
     $road_map_id = prepareIdOut($road_map_id, $host);
     $F = array();
     $F['road_map_id'] = $road_map_id;
     $F['title'] = $title;
     $F['image'] = $image;
     $F['header'] = $header;
     $F['footer'] = $footer;
     // Keys
     $F['keys'] = array();
     while ($Keys = mysql_fetch_assoc($KeysResults)) {
         $name = $Keys['name'];
         $description = $Keys['description'];
         $K = array();
         $K['name'] = $name;
         $K['description'] = $description;
         array_push($F['keys'], $K);
开发者ID:api-evangelist,项目名称:road-map,代码行数:31,代码来源:m-road_map-road_map_id-get.php

示例2: function

<?php

$route = '/url/:url_id/tags/:tag/';
$app->delete($route, function ($url_id, $tag) use($app) {
    $host = $_SERVER['HTTP_HOST'];
    $url_id = prepareIdIn($url_id, $host);
    $ReturnObject = array();
    $request = $app->request();
    $param = $request->params();
    if ($tag != '') {
        $url_id = trim(mysql_real_escape_string($url_id));
        $tag = trim(mysql_real_escape_string($tag));
        $CheckTagQuery = "SELECT Tag_ID FROM tags where Tag = '" . $tag . "'";
        $CheckTagResults = mysql_query($CheckTagQuery) or die('Query failed: ' . mysql_error());
        if ($CheckTagResults && mysql_num_rows($CheckTagResults)) {
            $Tag = mysql_fetch_assoc($CheckTagResults);
            $tag_id = $Tag['Tag_ID'];
            $DeleteQuery = "DELETE FROM url_tag_pivot where Tag_ID = " . trim($tag_id) . " AND Blog_ID = " . trim($url_id);
            $DeleteResult = mysql_query($DeleteQuery) or die('Query failed: ' . mysql_error());
        }
        $tag_id = prepareIdOut($tag_id, $host);
        $F = array();
        $F['tag_id'] = $tag_id;
        $F['tag'] = $tag;
        $F['url_count'] = 0;
        array_push($ReturnObject, $F);
    }
    $app->response()->header("Content-Type", "application/json");
    echo format_json(json_encode($ReturnObject));
});
开发者ID:kinlane,项目名称:magnetic.jargon,代码行数:30,代码来源:m-dictionary-dictionary_id-tags-tag-get.php

示例3: AND

 if ($query != '') {
     $Query .= " AND (n.title LIKE '%" . $query . "%' OR n.details LIKE '%" . $query . "%')";
 }
 $Query .= " ORDER BY n." . $sort . " " . $order . " LIMIT " . $page . "," . $count;
 //echo $Query . "<br />";
 $contentResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($content = mysql_fetch_assoc($contentResult)) {
     $archive = 0;
     $content_id = $content['content_id'];
     $title = $content['title'];
     $details = $content['details'];
     $post_date = $content['post_date'];
     $modified_date = $content['modified_date'];
     // manipulation zone
     $host = $_SERVER['HTTP_HOST'];
     $content_id = prepareIdOut($content_id, $host);
     $F = array();
     $F['content_id'] = $content_id;
     $F['title'] = $title;
     $F['details'] = $details;
     $F['post_date'] = $post_date;
     $F['modified_date'] = $modified_date;
     $F['tags'] = array();
     $TagQuery = "SELECT t.tag_id, t.tag from tags t";
     $TagQuery .= " INNER JOIN content_tag_pivot npt ON t.tag_id = npt.tag_id";
     $TagQuery .= " WHERE npt.content_ID = " . $content_id;
     $TagQuery .= " ORDER BY t.tag DESC";
     $TagResult = mysql_query($TagQuery) or die('Query failed: ' . mysql_error());
     while ($Tag = mysql_fetch_assoc($TagResult)) {
         $thistag = $Tag['tag'];
         $T = array();
开发者ID:Kin-Lane,项目名称:content,代码行数:31,代码来源:m-content-get.php

示例4: mysql_real_escape_string

        $curated_id = mysql_real_escape_string($params['curated_id']);
    } else {
        $curated_id = 0;
    }
    $Query = "SELECT * FROM dictionary WHERE Title = '" . $title . "' AND Author = '" . $author . "'";
    //echo $Query . "<br />";
    $Database = mysql_query($Query) or die('Query failed: ' . mysql_error());
    if ($Database && mysql_num_rows($Database)) {
        $ThisCertification = mysql_fetch_assoc($Database);
        $dictionary_id = $ThisCertification['ID'];
    } else {
        $Query = "INSERT INTO dictionary(Post_Date,Title,Author,Summary,Body,Footer,News_ID)";
        $Query .= " VALUES(";
        $Query .= "'" . mysql_real_escape_string($post_date) . "',";
        $Query .= "'" . mysql_real_escape_string($title) . "',";
        $Query .= "'" . mysql_real_escape_string($author) . "',";
        $Query .= "'" . mysql_real_escape_string($summary) . "',";
        $Query .= "'" . mysql_real_escape_string($body) . "',";
        $Query .= "'" . mysql_real_escape_string($footer) . "',";
        $Query .= mysql_real_escape_string($curated_id);
        $Query .= ")";
        //echo $Query . "<br />";
        mysql_query($Query) or die('Query failed: ' . mysql_error());
        $dictionary_id = mysql_insert_id();
    }
    $host = $_SERVER['HTTP_HOST'];
    $dictionary_id = prepareIdOut($dictionary_id, $host);
    $ReturnObject['dictionary_id'] = $dictionary_id;
    $app->response()->header("Content-Type", "application/json");
    echo format_json(json_encode($ReturnObject));
});
开发者ID:Kin-Lane,项目名称:dictionary,代码行数:31,代码来源:m-dictionary-post.php

示例5: mysql_query

 $Query .= " WHERE Tag = '" . $tag . "'";
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $report_id = $Database['report_id'];
     $report_date = $Database['report_date'];
     $name = $Database['name'];
     $title = $Database['title'];
     $content = $Database['content'];
     // manipulation zone
     $TagQuery = "SELECT t.tag_id, t.tag from tags t";
     $TagQuery .= " INNER JOIN report_tag_pivot utp ON t.tag_id = utp.tag_id";
     $TagQuery .= " WHERE utp.Blog_ID = " . $report_id;
     $TagQuery .= " ORDER BY t.tag DESC";
     $TagResult = mysql_query($TagQuery) or die('Query failed: ' . mysql_error());
     $host = $_SERVER['HTTP_HOST'];
     $report_id = prepareIdOut($report_id, $host);
     $F = array();
     $F['report_id'] = $report_id;
     $F['report_date'] = $report_date;
     $F['name'] = $name;
     $F['title'] = $title;
     $F['content'] = $content;
     $F['tags'] = array();
     while ($Tag = mysql_fetch_assoc($TagResult)) {
         $thistag = $Tag['tag'];
         $T = array();
         $T = $thistag;
         array_push($F['tags'], $T);
         //echo $thistag . "<br />";
         if ($thistag == 'Archive') {
             $archive = 1;
开发者ID:kinlane,项目名称:tsa.report,代码行数:31,代码来源:m-report-tags-tag-report-get.php

示例6: mysql_query

 $Query .= " JOIN link  ON ltp.link_id = l.link_id";
 $Query .= " WHERE tag = '" . $tag . "'";
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $link_id = $Database['link_id'];
     $created_date = $Database['created_date'];
     $url = $Database['url'];
     $short_url = $Database['short_url'];
     // manipulation zone
     $TagQuery = "SELECT t.tag_id, t.tag from tags t";
     $TagQuery .= " INNER JOIN link_tag_pivot ltp ON t.tag_id = ltp.tag_id";
     $TagQuery .= " WHERE ltp.link_id = " . $link_id;
     $TagQuery .= " ORDER BY t.tag DESC";
     $TagResult = mysql_query($TagQuery) or die('Query failed: ' . mysql_error());
     $host = $_SERVER['HTTP_HOST'];
     $link_id = prepareIdOut($link_id, $host);
     $F = array();
     $F['link_id'] = $link_id;
     $F['created_date'] = $created_date;
     $F['url'] = $url;
     $F['short_url'] = $short_url;
     $F['tags'] = array();
     while ($Tag = mysql_fetch_assoc($TagResult)) {
         $thistag = $Tag['tag'];
         $T = array();
         $T = $thistag;
         array_push($F['tags'], $T);
         //echo $thistag . "<br />";
         if ($thistag == 'Archive') {
             $archive = 1;
         }
开发者ID:kinlane,项目名称:apis.how,代码行数:31,代码来源:m-link-tags-tag-url-get.php

示例7: mysql_query

     $Query = "SELECT * FROM authentication";
 }
 $Query .= " ORDER BY " . $sort . " " . $order . " LIMIT " . $page . "," . $count;
 //echo $Query . "<br />";
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $authentication_id = $Database['authentication_id'];
     $title = $Database['title'];
     $image = $Database['image'];
     $header = $Database['header'];
     $footer = $Database['footer'];
     $KeysQuery = "SELECT * from keys k";
     $KeysQuery .= " WHERE authentication_id = " . $authentication_id;
     $KeysQuery .= " ORDER BY name ASC";
     $KeysResults = mysql_query($KeysQuery) or die('Query failed: ' . mysql_error());
     $authentication_id = prepareIdOut($authentication_id, $host);
     $F = array();
     $F['authentication_id'] = $authentication_id;
     $F['title'] = $title;
     $F['image'] = $image;
     $F['header'] = $header;
     $F['footer'] = $footer;
     // Keys
     $F['keys'] = array();
     while ($Keys = mysql_fetch_assoc($KeysResults)) {
         $name = $Keys['name'];
         $description = $Keys['description'];
         $K = array();
         $K['name'] = $name;
         $K['description'] = $description;
         array_push($F['keys'], $K);
开发者ID:api-evangelist,项目名称:authentication,代码行数:31,代码来源:m-authentication-get.php

示例8: mysql_insert_id

     $support_id = mysql_insert_id();
 }
 $ReturnObject = array();
 $Query = "SELECT * FROM support WHERE support_id = " . $support_id;
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $support_id = $Database['support_id'];
     $title = $Database['title'];
     $image = $Database['image'];
     $header = $Database['header'];
     $footer = $Database['footer'];
     $resourcesQuery = "SELECT * from resources r";
     $resourcesQuery .= " WHERE support_id = " . $support_id;
     $resourcesQuery .= " ORDER BY title ASC";
     $resourcesResults = mysql_query($resourcesQuery) or die('Query failed: ' . mysql_error());
     $support_id = prepareIdOut($support_id, $host);
     $F = array();
     $F['support_id'] = $support_id;
     $F['title'] = $title;
     $F['image'] = $image;
     $F['header'] = $header;
     $F['footer'] = $footer;
     // resources
     $F['resources'] = array();
     while ($resources = mysql_fetch_assoc($resourcesResults)) {
         $title = $resources['title'];
         $description = $resources['description'];
         $image = $resources['image'];
         $url = $resources['url'];
         $K = array();
         $K['title'] = $title;
开发者ID:api-evangelist,项目名称:support,代码行数:31,代码来源:m-support-post.php

示例9: mysql_query

 //echo $Query . "<br />";
 $DatabaseResult = mysql_query($Query) or die('Query failed: ' . mysql_error());
 while ($Database = mysql_fetch_assoc($DatabaseResult)) {
     $url_id = $Database['url_id'];
     $pull_date = $Database['pull_date'];
     $title = $Database['title'];
     $content = $Database['content'];
     $url = $Database['url'];
     $TagQuery = "SELECT t.tag_id, t.tag from tags t";
     $TagQuery .= " INNER JOIN url_tag_pivot utp ON t.tag_id = utp.tag_id";
     $TagQuery .= " WHERE utp.url_id = " . $url_id;
     $TagQuery .= " ORDER BY t.tag DESC";
     $TagResult = mysql_query($TagQuery) or die('Query failed: ' . mysql_error());
     // manipulation zone
     $host = $_SERVER['HTTP_HOST'];
     $url_id = prepareIdOut($url_id, $host);
     $F = array();
     $F['url_id'] = $url_id;
     $F['pull_date'] = $pull_date;
     $F['title'] = $title;
     $F['content'] = $content;
     $F['url'] = $url;
     $F['tags'] = array();
     while ($Tag = mysql_fetch_assoc($TagResult)) {
         $thistag = $Tag['tag'];
         $T = array();
         $T = $thistag;
         array_push($F['tags'], $T);
     }
     array_push($ReturnObject, $F);
 }
开发者ID:kinlane,项目名称:magnetic.jargon,代码行数:31,代码来源:m-dictionary-get.php

示例10: function

<?php

$route = '/content/:content_id/images/:content_image_id';
$app->put($route, function ($content_id, $content_image_id) use($app) {
    $host = $_SERVER['HTTP_HOST'];
    $content_id = prepareIdIn($content_id, $host);
    $content_image_id = prepareIdIn($content_image_id, $host);
    $ReturnObject = array();
    $request = $app->request();
    $param = $request->params();
    if (isset($param['path'])) {
        $type = trim(mysql_real_escape_string($param['type']));
        $path = trim(mysql_real_escape_string($param['path']));
        $name = trim(mysql_real_escape_string($param['name']));
        $query = "UPDATE content_image SET type = '" . $type . "', image_url = '" . $path . "', image_name = '" . $name . "' WHERE content_image_id = " . $content_image_id;
        mysql_query($query) or die('Query failed: ' . mysql_error());
        $image_id = mysql_insert_id();
        $image_id = prepareIdOut($image_id, $host);
        $F = array();
        $F['image_id'] = $image_id;
        $F['name'] = $name;
        $F['path'] = $path;
        $F['type'] = $type;
        array_push($ReturnObject, $F);
    }
    $app->response()->header("Content-Type", "application/json");
    echo stripslashes(format_json(json_encode($ReturnObject)));
});
开发者ID:Kin-Lane,项目名称:content,代码行数:28,代码来源:m-content-content_id-images-content_image_id-put.php


注:本文中的prepareIdOut函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。