<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; Ошибка Query failed_tl : You have an error in your SQL...]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=2609&amp;type=atom" />
	<updated>2012-07-08T18:22:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=2609</id>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20676#p20676" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Aдиль сказал:</cite><blockquote><p>к сожалению не помогает</p></blockquote></div><p>Запрос выводит что-нибудь в phpMyAdmin? Или таблицы tracklist в базе данных вообще нет?</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2012-07-08T18:22:02Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20676#p20676</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20675#p20675" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Aдиль сказал:</cite><blockquote><div class="quotebox"><cite>Hanut сказал:</cite><blockquote><p>Попробуйте выполнить в phpMyAdmin запрос:<br /></p><div class="codebox"><pre><code>SELECT * FROM `tracklist` ORDER BY `id` DESC</code></pre></div><p>Судя по скрипту, он выдает ошибку.</p></blockquote></div><p>к сожалению не помогает</p></blockquote></div><p>Хотя все проблему решил</p>]]></content>
			<author>
				<name><![CDATA[Aдиль]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4425</uri>
			</author>
			<updated>2012-07-08T18:21:37Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20675#p20675</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20674#p20674" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Hanut сказал:</cite><blockquote><p>Попробуйте выполнить в phpMyAdmin запрос:<br /></p><div class="codebox"><pre><code>SELECT * FROM `tracklist` ORDER BY `id` DESC</code></pre></div><p>Судя по скрипту, он выдает ошибку.</p></blockquote></div><p>к сожалению не помогает</p>]]></content>
			<author>
				<name><![CDATA[Aдиль]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4425</uri>
			</author>
			<updated>2012-07-08T17:53:10Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20674#p20674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20673#p20673" />
			<content type="html"><![CDATA[<p>Попробуйте выполнить в phpMyAdmin запрос:<br /></p><div class="codebox"><pre><code>SELECT * FROM `tracklist` ORDER BY `id` DESC</code></pre></div><p>Судя по скрипту, он выдает ошибку.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2012-07-08T17:46:16Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20673#p20673</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20672#p20672" />
			<content type="html"><![CDATA[<p>Могу дать экспортированный sql файл <a href="http://narod.ru/disk/55685191001.4d5050cbeafaf620056e4c29302e2d74/radio.sql.html">http://narod.ru/disk/55685191001.4d5050 … o.sql.html</a>, и сам скрипт:<br /></p><div class="codebox"><pre><code>&lt;?php
include &#039;set_db.php&#039;;
include &#039;config.php&#039;;

$query = &quot;SELECT * FROM `settings` WHERE `name` = &#039;online&#039; LIMIT 1 &quot;;
$result = mysql_query($query) or die(&quot;Query failed : &quot; . mysql_error());
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {$on_air = $line[&#039;value&#039;];}


// опередляем параметры
$status_ip = $ip;
$status_port = $port;

$status_vivod = 7; // сколько выводить
if ($net_povtorov &gt; $status_vivod) $status_vivod = $net_povtorov; // но не меньше чем нужно для плейлиста на главной

// подключаемся к серверу
$fp2 = fsockopen($status_ip, $status_port, $errno, $errstr, 1); //open connection
if(!$fp2) {
    $status_success=2;  //set if no connection
}

// если успешно подключились
if($status_success!=2){ //if connection
 fputs($fp2,&quot;GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n&quot;); //get status2.xsl
 while(!feof($fp2)) {
  $page .= fgets($fp2, 1000);
 }
 fclose($fp2); //close connection
 $page = ereg_replace(&quot;.*&lt;pre&gt;&quot;, &quot;&quot;, $page); //extract data
 $page = ereg_replace(&quot;&lt;/pre&gt;.*&quot;, &quot;,&quot;, $page); //extract data
 $page = str_replace(&quot;\n&quot;,&quot;&quot;,$page);
    $rf_ez = file($cf_ezstream);
    if ($rf_ez) {for ($i=0; $i&lt;count($rf_ez); $i++) {
    if (strpos($rf_ez[$i], &#039;&lt;url&gt;&#039;)!==false) {
    $cf_ez_url = $rf_ez[$i];}}}
    $cf_ez_url =  str_replace(&quot;&lt;/url&gt;&quot;,&quot;&quot;,$cf_ez_url);
    $cf_ez_url =  str_replace(&quot;&lt;url&gt;&quot;,&quot;&quot;,$cf_ez_url);
    $cf_ez_url = explode(&quot;/&quot;,$cf_ez_url);
    $cf_ez_url = $cf_ez_url[3];
    $cf_ez_url = str_replace(&quot;\n&quot;,&quot;&quot;,$cf_ez_url);
    $cf_ez_url = trim($cf_ez_url);

 $numbers = explode(&quot;,/&quot;,$page);
 unset($numbers[0]);
 foreach ($numbers as $value) {
     if (isset($full_numbers)) {$full_numbers .= &quot;||$value&quot;;} else {$full_numbers = &quot;$value&quot;;}
 }

 $full_numbers = addslashes($full_numbers);

 if (!function_exists(&quot;iconv&quot;)) {echo &quot;Библиотека iconv не установлена.&quot;;} else { $full_numbers= iconv(&#039;UTF-8&#039;,&#039;windows-1251&#039; ,$full_numbers); }

 if ($full_numbers!=&quot;&quot;) {
     $query=&quot;SELECT * FROM  `settings` WHERE `name`=&#039;listeners&#039; LIMIT 1&quot;;
     $result = mysql_query($query) or die(&quot;Query failed : &quot; . mysql_error());
    if ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $query=&quot; UPDATE `settings` SET `value` = &#039;$full_numbers&#039; WHERE `name`= &#039;listeners&#039;;&quot;;
         $result=mysql_query($query) or die(&quot;Query failed 4: &quot; . mysql_error());;
    } else {
        $query=&quot;INSERT INTO `settings` ( `name` , `value` ) VALUES (&#039;listeners&#039;, &#039;$full_numbers&#039;);&quot;;
         $result=mysql_query($query);
    }
    $query=&quot;SELECT * FROM  `settings` WHERE `name`=&#039;listeners&#039; LIMIT 1&quot;;
     $result = mysql_query($query) or die(&quot;Query failed : &quot; . mysql_error());
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $full_numbers = $line[&#039;value&#039;];
    }

     $full_numbers = explode(&quot;||&quot;,$full_numbers);
     foreach ($full_numbers as $value) {
         $value = explode(&quot;,&quot;,$value);
         if ($value[0]==$cf_ez_url) {
             $status_cur_song = $value[5];
             $tochka = $value[0];
         }
     }

    $system_stream = &quot;&quot;;
    $query=&quot;SELECT * FROM  `settings` WHERE `name`=&#039;stream&#039; LIMIT 1&quot;;
     $result = mysql_query($query) or die(&quot;Query failed : &quot; . mysql_error());
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $system_stream = $line[&#039;value&#039;];
    }
    $system_stream = explode(&quot;,&quot;,$system_stream);
    $system_stream[] = $tochka;
    $stream = array(&quot;&quot;);
    foreach ($system_stream as $v) {
        $stream[] = trim($v);
    }
    $stream = array_unique($stream);
    $listeners = 0;
     foreach ($full_numbers as $value) {
         $value = explode(&quot;,&quot;,$value);
         foreach ($stream as $v) {
            if ($value[0]==$v) {
                $listeners = $listeners+$value[3];
            }
        }
    }
 }
}
if ($listeners == &quot;&quot; ) { $listeners = 0; }
$status_listeners = $listeners;
//echo &quot;&lt;br&gt;$listeners&quot;;
//разделяем артиста и заголовок
preg_match(&quot;/^([^$]+) - ([^$]+)$/&quot;,$status_cur_song, $matches);

$arr_artist = explode(&quot; - &quot;,$matches[1]);
$seychat[artist] = $arr_artist[1]; // артист
$seychat[title] = $matches[2]; // исполнитель
$status_cur_song = &quot;$seychat[artist] - $seychat[title]&quot;;
//echo &quot;$seychat[artist] - $seychat[title]&lt;br&gt;&quot;;

// получаем адрес файла
$query = &quot;SELECT * FROM `songlist` WHERE `artist` LIKE &#039;&quot;.addslashes($seychat[artist]).&quot;&#039; and `title` LIKE &#039;&quot;.addslashes($seychat[title]).&quot;&#039;&quot;;
$update_result = mysql_query($query);
if ($line = mysql_fetch_array($update_result, MYSQL_ASSOC)) {
$update_filename = $line[&#039;filename&#039;];
$update_idsong =  $line[&#039;idsong&#039;];
}
//echo $update_filename;

// получаем последнюю добавленную строку
$status_result = mysql_query(&quot;SELECT * FROM `tracklist` ORDER BY `id` DESC LIMIT 10&quot;);
$status_title0 = mysql_result($status_result,0,&quot;title&quot;);
$update_idsong0 = mysql_result($status_result,0,&quot;idsong&quot;);
$update_idsong1 = mysql_result($status_result,1,&quot;idsong&quot;);
$update_idsong_id1 = mysql_result($status_result,1,&quot;id&quot;);

// Убираем два одинаковых трека
if ($update_idsong1 == $update_idsong0) {
    mysql_query(&quot; DELETE FROM `tracklist` WHERE `id` = &#039;$update_idsong_id1&#039; &quot;);
}

//если есть системная константа
$system_symvol = strpos($status_cur_song, $system_symvol);

$time = date(&quot;U&quot;);

/* отображать live вместо play (если есть подключение к live) */
/*
    foreach ($full_numbers as $value) {
         $value = explode(&quot;,&quot;,$value);
            if ($value[0]==&quot;live&quot;) {
                $ssd = explode (&quot;-&quot;,$value[5]);
                $status_cur_song = $ssd[1].&quot; - &quot;.$ssd[2];
        }
    }
*/
/* end */

// если проблемы
if ( $status_cur_song == &quot;&quot; ) {
    $status_cur_song = &quot;Нет данных&quot;;
}

// если прямой эфир
if ( $on_air == &quot;2&quot; ) {
    $status_cur_song = &quot;Прямой эфир&quot;;
}

// добовляем новую строку
if (($status_title0 != $status_cur_song) and ($system_symvol === false)) {
mysql_query(&quot;INSERT INTO `tracklist` ( `title`, `filename`,  `idsong`,  `time`) VALUES (&#039;&quot;.addslashes($status_cur_song).&quot;&#039;, &#039;$update_filename&#039;, &#039;$update_idsong&#039;, &#039;$time&#039;)&quot;);}


// не допускаем повторы
$net_povtorov_array = array();
$ipp = 0;
$query = &quot;SELECT * FROM `tracklist` ORDER BY `id` DESC LIMIT &quot;.$net_povtorov;
$result = mysql_query($query) or die(&quot;Query failed_tl : &quot; . mysql_error());
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $net_povtorov_array[$ipp] = $line[&#039;filename&#039;];
    $ipp = $ipp+1;
}



$status_result = mysql_query(&quot;SELECT * FROM `tracklist` ORDER BY `id` DESC LIMIT 10&quot;);
$t = 0;
while ($line = mysql_fetch_array($status_result, MYSQL_ASSOC)) {
    $t_p[$t] = $line[&#039;title&#039;];
    $t++;
}


$trackplay9 = $t_p[8];
$trackplay8 = $t_p[7];
$trackplay7 = $t_p[6];
$trackplay6 = $t_p[5];
$trackplay5 = $t_p[4];
$trackplay4 = $t_p[3];
$trackplay3 = $t_p[2];
$trackplay2 = $t_p[1]; // то что выше - играло раньше
$trackplay1 = $t_p[0]; // сейчас играет

$dlinna1 = strlen($trackplay1);
$dlinna2 = strlen($trackplay2);
$dlinna3 = strlen($trackplay3);
$dlinna4 = strlen($trackplay4);
$dlinna5 = strlen($trackplay5);
$dlinna6 = strlen($trackplay6);

// Сокращать названия если там больше $obr символов
$obr = 60;

if ($dlinna1 &gt; $obr) {$trackplay1 = substr($trackplay1, 0, $obr);  $trackplay1 = $trackplay1.&#039;..&#039;;}
if ($dlinna2 &gt; $obr) {$trackplay2 = substr($trackplay2, 0, $obr);  $trackplay2 = $trackplay2.&#039;..&#039;;}
if ($dlinna3 &gt; $obr) {$trackplay3 = substr($trackplay3, 0, $obr);  $trackplay3 = $trackplay3.&#039;..&#039;;}
if ($dlinna4 &gt; $obr) {$trackplay4 = substr($trackplay4, 0, $obr);  $trackplay4 = $trackplay4.&#039;..&#039;;}
if ($dlinna5 &gt; $obr) {$trackplay5 = substr($trackplay5, 0, $obr);  $trackplay5 = $trackplay5.&#039;..&#039;;}
if ($dlinna6 &gt; $obr) {$trackplay6 = substr($trackplay6, 0, $obr);  $trackplay6 = $trackplay6.&#039;..&#039;;}

if ($trackplay1 == &quot;&quot; or $trackplay1 == &quot; - &quot;) {$trackplay1 = &quot;Нет данных&quot;;}
if ($trackplay2 == &quot;&quot; or $trackplay2 == &quot; - &quot;) {$trackplay2 = &quot;Нет данных&quot;;}
if ($trackplay3 == &quot;&quot; or $trackplay3 == &quot; - &quot;) {$trackplay3 = &quot;Нет данных&quot;;}
if ($trackplay4 == &quot;&quot; or $trackplay4 == &quot; - &quot;) {$trackplay4 = &quot;Нет данных&quot;;}
if ($trackplay5 == &quot;&quot; or $trackplay5 == &quot; - &quot;) {$trackplay5 = &quot;Нет данных&quot;;}
if ($trackplay6 == &quot;&quot; or $trackplay6 == &quot; - &quot;) {$trackplay6 = &quot;Нет данных&quot;;}

$status_q = mysql_query(&quot;SELECT * FROM `tracklist`&quot;);
$status_zapisei = mysql_num_rows($status_q);

// удаляем лишнюю строку
mysql_query(&quot;DELETE FROM `tracklist` WHERE $status_zapisei&gt;$status_vivod ORDER BY `id` LIMIT 2;&quot;);

?&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Aдиль]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4425</uri>
			</author>
			<updated>2012-07-08T17:20:27Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20672#p20672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20670#p20670" />
			<content type="html"><![CDATA[<p>Могу только предположить, что вместо failed_tl должен быть запрос. Попробуйте посмотреть журнал ошибок сервера.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2012-07-08T17:04:59Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20670#p20670</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Ошибка Query failed_tl : You have an error in your SQL...]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=20668#p20668" />
			<content type="html"><![CDATA[<p>Всем привет, есть одна cms Radiocms (система управления интернет радио-станцией), а там есть и внешние модули вот и в них проблема, создаю файл php ну а там код, потом сохраняю и заливаю файл перехожу, а там мне пишет:<br /></p><div class="codebox"><pre><code>Query failed_tl : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;&#039; at line 1</code></pre></div><p>к сожалению экспортированный файл sql дать не могу, т.к он слишком большой</p>]]></content>
			<author>
				<name><![CDATA[Aдиль]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4425</uri>
			</author>
			<updated>2012-07-08T15:25:57Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=20668#p20668</id>
		</entry>
</feed>
