我只看到这个艺术品
在这种情况下,我需要知道什么是最佳的绩效
如果在查询中的陈述
SELECT *,if( status = 1 , "active" ,"unactive") as status_val FROM comments
VS
<?php
$x = mysql_query("SELECT * FROM comments");
while( $res = mysql_fetch_assoc( $x ) ){
if( $x['status'] == 1 ){
$status_val = 'active';
}else{
$status_val = 'unactive';
}
}
?>
Run Code Online (Sandbox Code Playgroud)
从字符串切10
SELECT * , SUBSTR(comment, 0, 10) as min_comment FROM comments
VS
<?php
$x = mysql_query("SELECT * FROM comments");
while( $res = mysql_fetch_assoc( $x ) ){
$min_comment = substr( $x['comment'],0,10 ) ;
}
?> …Run Code Online (Sandbox Code Playgroud) 我正在寻找获得结果的最佳方法,数据库包含超过100000 Post和超过100000 Cat
这是我的桌子
猫
-----------------
- id | name |
-----------------
- 1 | x |
-----------------
- 2 | y |
-----------------
Run Code Online (Sandbox Code Playgroud)
岗位
--------------------------------------
- id | cat_id | title | content |
--------------------------------------
- 1 | 1 | Post 1 | .. . . .|
--------------------------------------
- 2 | 1 | Post 2 | . . . . .|
--------------------------------------
- 3 | 2 | Post 3 | .. . . .|
--------------------------------------
- 4 | 1 …Run Code Online (Sandbox Code Playgroud) 我值得注意的是在服务器上使用 curl连接这个站点http://www.youm7.com/newtkarirrss.asp
但我可以从本地主机访问它没有任何问题
这是测试
http://www.tjreb.com/xml_grabber.php?feed=http://www.youm7.com/newtkarirrss.asp&stack=1
试试 CNN RSS 提要
http://www.tjreb.com/xml_grabber.php?feed=http://rss.cnn.com/rss/edition_meast.rss&stack=0
我怎样才能绕过这个错误
这是我的源代码
<?php
class xml_grabber
{
private $xml_file = '' ;
private $xml_link = '' ;
private $xml_dom = '' ;
private $xml_type = '' ;
private $xml_content = '' ;
private $xml_errors = array() ;
public $xml_stack = 0 ;
public function __construct($link_file_com = '')
{
if(!$link_file_com)
{
$this->xml_errors['construct'] = 'No Xml In Construct' ;
return false;
}
elseif(!function_exists('simplexml_load_file') || !function_exists('simplexml_load_string') || !function_exists('simplexml_import_dom'))
{
$this->xml_errors['functions'] = …Run Code Online (Sandbox Code Playgroud) 这是我的表格
注意 此表仅供参考
帖子
++++++++++++++++++++++++++++++++++++++++
+ id |title | desc | uid |status |
++++++++++++++++++++++++++++++++++++++++
+ 1 | a | aaaa | 1 | 1 |
++++++++++++++++++++++++++++++++++++++++
+ 2 | b | bbbb | 1 | 1 |
++++++++++++++++++++++++++++++++++++++++
+ 3 | c | cccc | 2 | 1 |
++++++++++++++++++++++++++++++++++++++++
Run Code Online (Sandbox Code Playgroud)
猫
+++++++++++++++++++++++++++++++++
+ id | name |parent | status |
+++++++++++++++++++++++++++++++++
+ 1 | cat1 | 0 | 1 |
+++++++++++++++++++++++++++++++++
+ 2 | cat2 | 0 | 1 …Run Code Online (Sandbox Code Playgroud) mysql ×3
performance ×3
php ×3
benchmarking ×1
cloudflare ×1
join ×1
rss-reader ×1
sql ×1
xml-parsing ×1