本文整理汇总了PHP中eq_array函数的典型用法代码示例。如果您正苦于以下问题:PHP eq_array函数的具体用法?PHP eq_array怎么用?PHP eq_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eq_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 (\"[email protected]\"))";
$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
示例16: dirname
<?php
require_once dirname(__FILE__) . '/../../../php-sql-parser.php';
require_once dirname(__FILE__) . '/../../test-more.php';
$parser = new PHPSQLParser();
$sql = "SELECT 'a string with an escaped quote \\' in it' AS some_alias FROM some_table";
$parser->parse($sql, true);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue42.serialized');
eq_array($p, $expected, 'escaped quote in string constant');
开发者ID:sakuraiyuta,项目名称:fuel-orientdb,代码行数:10,代码来源:issue42.php
示例17: dirname
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = 'SELECT
1';
$p = $parser->parse($sql);
ok(count($p) == 1 && count($p['SELECT']) == 1);
ok($p['SELECT'][0]['expr_type'] == 'const');
ok($p['SELECT'][0]['base_expr'] == '1');
ok($p['SELECT'][0]['sub_tree'] == '');
$sql = 'SELECT 1+2 c1, 1+2 as c2, 1+2, sum(a) sum_a_alias,a,a an_alias, a as another_alias,terminate
from some_table an_alias
where d > 5;';
$parser->parse($sql);
$p = $parser->parsed;
ok(count($p) == 3 && count($p['SELECT']) == 8);
ok($p['SELECT'][count($p['SELECT']) - 1]['base_expr'] == 'terminate');
ok(count($p) == 3 && count($p['FROM']) == 1);
ok(count($p) == 3 && count($p['WHERE']) == 3);
$parser->parse('SELECT NOW( ),now(),sysdate( ),sysdate () as now');
ok($parser->parsed['SELECT'][3]['base_expr'] == 'sysdate');
$sql = " SELECT a.*, surveyls_title, surveyls_description, surveyls_welcometext, surveyls_url FROM SURVEYS AS a INNER JOIN SURVEYS_LANGUAGESETTINGS on (surveyls_survey_id=a.sid and surveyls_language=a.language) order by active DESC, surveyls_title";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'select1.serialized');
eq_array($p, $expected, 'a test for ref_clauses');
$sql = "SELECT pl_namespace,pl_title FROM `pagelinks` WHERE pl_from = '1' FOR UPDATE";
$parser->parse($sql);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'select2.serialized');
eq_array($p, $expected, 'select for update');
开发者ID:suryasingh,项目名称:aggregatenav,代码行数:30,代码来源:select.php
示例18: dirname
<?php
require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$sql = "select `column` from table where col=\"value\"";
$parser = new PHPSQLParser($sql, true);
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'issue70.serialized');
eq_array($p, $expected, 'quotes after an operator should not fail.');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:9,代码来源:issue70.php
示例19: dirname
<?php
require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
$parser = new PHPSQLParser();
$sql = 'SELECT SUM( 10 ) as test FROM account';
$p = $parser->parse($sql);
$expected = getExpectedValue(dirname(__FILE__), 'issue21.serialized');
eq_array($p, $expected, 'only space characters within SQL statement');
$sql = "SELECT\tSUM( 10 ) \tas test FROM account";
$p = $parser->parse($sql);
$expected = getExpectedValue(dirname(__FILE__), 'issue21.serialized');
// should be the same as above
eq_array($p, $expected, 'tab character within SQL statement');
开发者ID:garv347,项目名称:swanhart-tools,代码行数:14,代码来源:issue21.php
示例20: dirname
<?php
require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";
// thats an issue written as comment into the ParserManual...
// TODO: the ON clause base_expr contains ")", which fails in PositionCalculator->findPositionWithinString()
$sql = "SELECT FROM some_table a LEFT JOIN another_table AS b ON FIND_IN_SET(a.id, b.ids_collection)";
try {
$parser = new PHPSQLParser($sql, true);
} catch (UnableToCalculatePositionException $e) {
echo $e->getMessage();
}
$p = $parser->parsed;
$expected = getExpectedValue(dirname(__FILE__), 'manual.serialized');
eq_array($p, $expected, 'no select expression');
开发者ID:suryasingh,项目名称:aggregatenav,代码行数:15,代码来源:manual.php
注:本文中的eq_array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论