Как сделать Нет подарков ? - Visavi.net https://visavi.net/ RSS - Visavi.net https://visavi.net/assets/img/images/logo_small.png RSS - Visavi.net https://visavi.net/ [email protected] (admin) [email protected] (admin) Fri, 27 Dec 2024 11:57:12 +0300 <pre class="prettyprint">echo &#039;&lt;div class=&quot;act&quot;&gt;&#039;; $pod_count = DB&#58;&#58;run() -&gt; querySingle(&quot;SELECT COUNT(*) FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039;&quot;); echo &#039;&lt;b&gt;Подарки&lt;/b&gt; | &lt;a href=&quot;&#039;.BASEDIR.&#039;pages/pod.php?uz=&#039;.$uz.&#039;&quot;&gt;Все подарки&lt;/a&gt; (&#039;.$pod_count.&#039;)&#039;; echo &#039;&lt;/div&gt;&#039;; echo &#039;&lt;div class=&quot;gifts&quot;&gt;&#039;; if($pod_count == 0) { echo &#039;&lt;img src=&quot;ico/gift.png&quot;&gt; Нет подарков&#039;; } else { $s = DB&#58;&#58;run() -&gt; query(&quot;SELECT * FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039; ORDER BY `id` DESC LIMIT 3&quot;); while ($pd = $s -&gt; fetch()) { echo &#039;&lt;img height=&quot;50&quot; src=&quot;&#039;.BASEDIR.&#039;/images/pod/&#039;. $pd&#91;&#039;pod_id&#039;] .&#039;.png&quot; /&gt; &#039;; } } echo &#039;&lt;/div&gt;&#039;;</pre> https://visavi.net/topics/38260/638950 Как сделать Нет подарков ? iNeeXT Mon, 24 Jun 2013 23:46:20 +0400 Сообщения https://visavi.net/topics/38260/638950 Вот код<br> echo &#039;&lt;div class=&quot;act&quot;&gt;&#039;; <br> $pod_count = DB::run() -&gt; querySingle(&quot;SELECT COUNT(*) FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039;&quot;); <br> echo &#039;&lt;b&gt;Подарки&lt;/b&gt; | &lt;a href=&quot;&#039;.BASEDIR.&#039;pages/pod.php?uz=&#039;.$uz.&#039;&quot;&gt;Все подарки&lt;/a&gt; (&#039;.$pod_count.&#039;)&#039;; <br> echo &#039;&lt;/div&gt;&#039;; <br> echo &#039;&lt;div class=&quot;gifts&quot;&gt;&#039;; <br> $s = DB::run() -&gt; query(&quot;SELECT * FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039; ORDER BY `id` DESC LIMIT 3&quot;);<br> while ($pd = $s -&gt; fetch()) {<br> echo &#039;&lt;img height=&quot;50&quot; src=&quot;&#039;.BASEDIR.&#039;/images/pod/&#039;. $pd[&#039;pod_id&#039;] .&#039;.png&quot; /&gt; &#039;; } <br> echo &#039;&lt;/div&gt;&#039;;<br> <br> <br> в нем надо сделать если нету подарков, то &quot;Нет подарков&quot; <br> <br> Ну типа так<br> else {echo &#039;&lt;img src=&quot;ico/gift.png&quot;&gt; Нет подарков&#039;;} <br> Просто у меня выводит ошибку <br> Делал так <br> <pre class="prettyprint">echo &#039;&lt;div class=&quot;act&quot;&gt;&#039;; $pod_count = DB&#58;&#58;run() -&gt; querySingle(&quot;SELECT COUNT(*) FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039;&quot;); echo &#039;&lt;b&gt;Подарки&lt;/b&gt; | &lt;a href=&quot;&#039;.BASEDIR.&#039;pages/pod.php?uz=&#039;.$uz.&#039;&quot;&gt;Все подарки&lt;/a&gt; (&#039;.$pod_count.&#039;)&#039;; echo &#039;&lt;/div&gt;&#039;; echo &#039;&lt;div class=&quot;gifts&quot;&gt;&#039;; $s = DB&#58;&#58;run() -&gt; query(&quot;SELECT * FROM `podarki_userov` WHERE `login_komu`=&#039;$uz&#039; ORDER BY `id` DESC LIMIT 3&quot;); while ($pd = $s -&gt; fetch()) { echo &#039;&lt;img height=&quot;50&quot; src=&quot;&#039;.BASEDIR.&#039;/images/pod/&#039;. $pd&#91;&#039;pod_id&#039;] .&#039;.png&quot; /&gt; &#039;; } echo &#039;&lt;/div&gt;&#039;; else {echo &#039;&lt;img src=&quot;ico/gift.png&quot;&gt; Нет подарков&#039;;} </pre> Исправьте кто может, пожалуйста https://visavi.net/topics/38260/638949 Как сделать Нет подарков ? NeKoder Mon, 24 Jun 2013 23:05:55 +0400 Сообщения https://visavi.net/topics/38260/638949