<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; if(!mysql_query())]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=2545&amp;type=atom" />
	<updated>2012-04-30T19:55:41Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=2545</id>
		<entry>
			<title type="html"><![CDATA[Re: if(!mysql_query())]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=19835#p19835" />
			<content type="html"><![CDATA[<p><a href="http://lv.php.net/manual/ru/function.mysql-num-rows.php">mysql_num_rows($result)</a>; // Вернет количество строк запроса или 0, если они не найдены.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2012-04-30T19:55:41Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=19835#p19835</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: if(!mysql_query())]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=19830#p19830" />
			<content type="html"><![CDATA[<p>Решил проблему вот так:</p><div class="codebox"><pre><code>$result = mysql_query($q);
        $exists=false;
        
        
              while($row=mysql_fetch_array($result))
                    {
                         if($row[uid]==$session_id)
                             {
                             $exists=true;break;
                             }
                    }
                    
            if($exists)
            {
                echo &#039;Est takoi uid&#039;;
            }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dikkiy]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4245</uri>
			</author>
			<updated>2012-04-30T15:26:44Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=19830#p19830</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: if(!mysql_query())]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=19829#p19829" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Hanut сказал:</cite><blockquote><p>Посмотрите как выглядит запрос и попробуйте выполнить его в phpMyAdmin.</p><p>Так же, смотрите логи веб-сервера, чтобы понять где ошибка.</p></blockquote></div><p>В phpmyadmin результат такой:<br /></p><div class="codebox"><pre><code>MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0252 sec )</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dikkiy]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4245</uri>
			</author>
			<updated>2012-04-30T13:59:02Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=19829#p19829</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: if(!mysql_query())]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=19824#p19824" />
			<content type="html"><![CDATA[<p>Посмотрите как выглядит запрос и попробуйте выполнить его в phpMyAdmin.</p><p>Так же, смотрите логи веб-сервера, чтобы понять где ошибка.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2012-04-30T08:26:19Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=19824#p19824</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[if(!mysql_query())]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=19823#p19823" />
			<content type="html"><![CDATA[<p>Помогите пожалуйста разобраться.<br /></p><div class="codebox"><pre><code>&lt;?php
include(&#039;config.php&#039;);

session_start(); $_SESSION[&#039;session_id&#039;] = rand(0,9999999999999); $session_id = $_SESSION[&#039;session_id&#039;];

$q = &quot;SELECT * FROM `katalog` where `uid` = &#039;$session_id&#039;&quot;;

echo $q;</code></pre></div><p><span style="color: orange">Нужно проверить есть ли поле с таким uid</span></p><div class="codebox"><pre><code>if(!$result=mysql_query($q))
    {
              echo &#039;Не найдено&#039;;</code></pre></div><p><span style="color: orange">В базе нет такого uid, должен же вывести &quot;Не найдено&quot;! Но не выводит <img src="https://forum.php-myadmin.ru/img/smilies/sad.png" width="15" height="15" alt="sad" /></span><br /></p><div class="codebox"><pre><code>    } else {
              while($row=mysql_fetch_array($result))
                    {
                        echo $row[uid];
                    }
                    
           }   </code></pre></div><p><span style="color: orange">Раз такой uid якобы есть, то почему не выводит его???</span></p>]]></content>
			<author>
				<name><![CDATA[Dikkiy]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4245</uri>
			</author>
			<updated>2012-04-30T05:07:59Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=19823#p19823</id>
		</entry>
</feed>
