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


PHP eq_array函数代码示例

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


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

示例1: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = "SELECT title, introtext\nFROM kj9un_content\nWHERE `id`='159'";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue43.serialized');
eq_array($p, $expected, 'problem with linefeed after tablename');
开发者ID:KRAETS,项目名称:kql,代码行数:10,代码来源:issue43.php

示例2: dirname

<?php

require_once dirname(__FILE__) . '/../../../php-sql-parser.php';
require_once dirname(__FILE__) . '/../../test-more.php';
$parser = new PHPSQLParser();
$sql = "INSERT INTO test (`name`, `test`) VALUES ('\\'Superman\\'', ''), ('\\'Superman\\'', '')";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue36a.serialized');
eq_array($p, $expected, 'INSERT statement with escaped quotes and multiple records');
$sql = "INSERT INTO test (`name`, `test`) VALUES ('\\'Superman\\'', '')";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue36b.serialized');
eq_array($p, $expected, 'INSERT statement with escaped quotes and one record');
$sql = "INSERT INTO test (`name`, `test`) VALUES ('\\'Superman\\'', ''), ('\\'sdfsd\\'', '')";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue36c.serialized');
eq_array($p, $expected, 'INSERT statement with escaped quotes and multiple records (2)');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:20,代码来源:issue36.php

示例3: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$sql = "select 1 as `a` order by `a`";
$parser = new PHPSQLParser($sql, true);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue93.serialized');
eq_array($p, $expected, 'simple query');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:9,代码来源:issue93.php

示例4: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$test = str_repeat('0', 18000);
$query = "UPDATE club SET logo='{$test}' WHERE id=1";
$parser = new PHPSQLParser();
$p = $parser->parse($query);
$expected = getExpectedValue(dirname(__FILE__), 'issue11.serialized');
eq_array($p, $expected, 'very long statement');
开发者ID:KRAETS,项目名称:kql,代码行数:10,代码来源:issue11.php

示例5: dirname

<?php

require_once dirname(__FILE__) . "/../../../php-sql-parser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = "SELECT * FROM contacts WHERE contacts.id IN (SELECT email_addr_bean_rel.bean_id FROM email_addr_bean_rel, email_addresses WHERE email_addresses.id = email_addr_bean_rel.email_address_id AND email_addr_bean_rel.deleted = 0 AND email_addr_bean_rel.bean_module = 'Contacts' AND email_addresses.email_address IN (\"test@example.com\"))";
$p = $parser->parse($sql);
$expected = getExpectedValue(dirname(__FILE__), 'issue25.serialized');
eq_array($p, $expected, 'parenthesis problem on issue 25');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:9,代码来源:issue25.php

示例6: dirname

<?php

require_once dirname(__FILE__) . '/../../../php-sql-parser.php';
require_once dirname(__FILE__) . '/../../test-more.php';
# optimizer/index hints
# not solved
$parser = new PHPSQLParser();
$sql = "insert /* +APPEND */ into TableName (Col1,col2) values(1,'pol')";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue56a.serialized');
eq_array($p, $expected, 'optimizer hint within INSERT');
# inline comment
# not solved
$sql = "SELECT acol -- an inline comment\nFROM --another comment\ntable\nWHERE x = 1";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue56b.serialized');
eq_array($p, $expected, 'inline comment should not fail, issue 56');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:19,代码来源:issue56.php

示例7: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$sql = "select i1, count(*) cnt from test.s1 group by i1";
$parser = new PHPSQLParser($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue65.serialized');
eq_array($p, $expected, 'It treats the alias as a colref.');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:9,代码来源:issue65.php

示例8: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = 'SELECT (select colA FRom TableA) as b From test t';
$p = $parser->parse($sql);
$expected = getExpectedValue(dirname(__FILE__), 'subselect1.serialized');
eq_array($p, $expected, 'sub-select with alias');
$sql = 'SELECT a.uid, a.users_name FROM USERS AS a LEFT JOIN (SELECT uid AS id FROM USER_IN_GROUPS WHERE ugid = 1) AS b ON a.uid = b.id WHERE id IS NULL ORDER BY a.users_name';
$p = $parser->parse($sql);
$expected = getExpectedValue(dirname(__FILE__), 'subselect2.serialized');
eq_array($p, $expected, 'sub-select as table replacement with alias');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:13,代码来源:subselect.php

示例9: dirname

<?php

require_once dirname(__FILE__) . '/../../../php-sql-parser.php';
require_once dirname(__FILE__) . '/../../test-more.php';
$sql = "select * from table1 as event";
$parser = new PHPSQLParser($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue71a.serialized');
eq_array($p, $expected, 'infinite loop on table alias "event"');
$sql = "select acol from table as data";
$parser = new PHPSQLParser($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue71b.serialized');
eq_array($p, $expected, 'infinite loop on table alias "data"');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:14,代码来源:issue71.php

示例10: dirname

<?php

require_once dirname(__FILE__) . '/../../../php-sql-parser.php';
require_once dirname(__FILE__) . '/../../test-more.php';
$parser = new PHPSQLParser();
$sql = "select a from t where x = \"a'b\\cd\" and y = 'ef\"gh'";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue40a.serialized');
eq_array($p, $expected, 'escaped characters 1');
$q2 = "select a from t where x = \"abcd\" and y = 'efgh'";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue40b.serialized');
eq_array($p, $expected, 'escaped characters 2');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:15,代码来源:issue40.php

示例11: dirname

<?php

require_once dirname(__FILE__) . "/../../../php-sql-parser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = 'SELECT colA hello From test t';
$p = $parser->parse($sql, true);
ok($p['SELECT'][0]['position'] == 7, 'position of column');
ok($p['SELECT'][0]['alias']['position'] == 12, 'position of column alias');
ok($p['FROM'][0]['position'] == 23, 'position of table');
ok($p['FROM'][0]['alias']['position'] == 28, 'position of table alias');
$sql = "SELECT colA hello From test\nt";
$p = $parser->parse($sql, true);
ok($p['SELECT'][0]['position'] == 7, 'position of column');
ok($p['SELECT'][0]['alias']['position'] == 12, 'position of column alias');
ok($p['FROM'][0]['position'] == 23, 'position of table');
ok($p['FROM'][0]['alias']['position'] == 28, 'position of table alias');
$sql = "SELECT a.*, c.*, u.users_name FROM SURVEYS as a  INNER JOIN SURVEYS_LANGUAGESETTINGS as c ON ( surveyls_survey_id = a.sid AND surveyls_language = a.language ) AND surveyls_survey_id=a.sid and surveyls_language=a.language  INNER JOIN USERS as u ON (u.uid=a.owner_id)  ORDER BY surveyls_title";
$p = $parser->parse($sql, true);
$expected = getExpectedValue(dirname(__FILE__), 'positions1.serialized');
eq_array($p, $expected, 'a long query with join and order clauses');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:21,代码来源:positions.php

示例12: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$sql = "SELECT CAST((CONCAT(table1.col1,' ',time_start)) AS DATETIME) FROM table1";
$parser = new PHPSQLParser($sql, true);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue62.serialized');
eq_array($p, $expected, 'CAST expression');
开发者ID:suryasingh,项目名称:aggregatenav,代码行数:9,代码来源:issue62.php

示例13: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = "SELECT COUNT(DISTINCT bla) FROM foo";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue39.serialized');
eq_array($p, $expected, 'count(distinct x)');
开发者ID:suryasingh,项目名称:aggregatenav,代码行数:10,代码来源:issue39.php

示例14: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = "SELECT CAST( 12 AS decimal( 9, 3 ) )";
$parser->parse($sql, true);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue51.serialized');
eq_array($p, $expected, 'should not die if query contains cast expression');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:10,代码来源:issue51.php

示例15: dirname

<?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = "drop table if exists xyz cascade";
$p = $parser->parse($sql, true);
$expected = getExpectedValue(dirname(__FILE__), 'drop.serialized');
eq_array($p, $expected, 'drop table statement');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:9,代码来源:drop.php


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