<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[errore query]]></title><description><![CDATA[<p dir="auto">ciao a tutti!</p>
<pre><code class="language-php">&lt;?php
                                                                mysql_query("SET CHARACTER SET utf8");
                                                                mysql_query("SET NAMES utf8");
                                                                $rowsPerPage = 20;
                                                                $pageNum = 1;
                                                                if (isset($_GET['page'])) {
                                                                    $pageNum = $_GET['page'];
                                                                }
                                                                $offset = ($pageNum - 1) * $rowsPerPage;
                                                                $lettera=$_REQUEST['lettera'];
                                                                if ($lettera == NULL) {
                                                                    $lettera = '';
                                                                } else {
                                                                    $lettera=$_REQUEST['lettera'];
                                                                }
                                                                if ($spec == NULL and $lettera == NULL and $tipo_medico == 1) {
                                                                    $Sqlqr_gl="select * from medici_chirurghi where cognome != '' order by IF (ASCII(LOWER(cognome)) &gt;=ASCII (LOWER('$lettera')),1,2),cognome LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_chirurghi where cognome != ''";
                                                                } else if ($spec == NULL and $lettera != NULL and $tipo_medico == 1) {
                                                                    $Sqlqr_gl="select * from medici_chirurghi where cognome != '' and cognome LIKE '$lettera%' order by cognome LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_chirurghi where cognome != '' and cognome LIKE '$lettera%'";
                                                                } else if ($spec != NULL and $tipo_medico == 1) {
                                                                    $Sqlqr_gl="select m.* from medici_chirurghi m, matricola_specialita ms, specialita2 s where cognome != '' and s.id_spec = $spec and s.id_spec = ms.id_specialita and m.matricola2 = ms.matricola order by IF (ASCII(LOWER(cognome)) &gt;=ASCII (LOWER('$lettera')),1,2),cognome LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_chirurghi m, matricola_specialita ms, specialita2 s where cognome != '' and s.id_spec = $spec and s.id_spec = ms.id_specialita and m.matricola2 = ms.matricola";
                                                                } else if ($spec == NULL and $lettera == NULL and $tipo_medico == 2) {
                                                                    $Sqlqr_gl="select * from medici_odontoiatri where cognome != '' order by IF (ASCII(LOWER(cognome)) &gt;=ASCII (LOWER('$lettera')),1,2),cognome LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_odontoiatri where cognome != ''";
                                                                } else if ($spec == NULL and $lettera != NULL and $tipo_medico == 2) {
                                                                    $Sqlqr_gl="select * from medici_odontoiatri where cognome != '' and cognome LIKE '$lettera%' order by cognome  LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_odontoiatri where cognome != '' and cognome LIKE '$lettera%'";
                                                                } else if ($spec != NULL  and $tipo_medico == 2) {
                                                                    $Sqlqr_gl="select m.* from medici_odontoiatri m, matricola_specialita ms, specialita2 s where cognome != '' and s.id_spec = $spec and s.id_spec = ms.id_specialita and m.matricola2 = ms.matricola order by IF (ASCII(LOWER(cognome)) &gt;=ASCII (LOWER('$lettera')),1,2),cognome LIMIT $offset, $rowsPerPage";
                                                                    $query="SELECT COUNT(m.id_albo) AS numrows from medici_odontoiatri m, matricola_specialita ms, specialita2 s where cognome != '' and s.id_spec = $spec and s.id_spec = ms.id_specialita and m.matricola2 = ms.matricola";
                                                                }
                                                                echo "&lt;div style=display:none&gt;".$Sqlqr_gl."&lt;/div&gt;";
                                                                $qr_gl=mysql_query($Sqlqr_gl,$connessione)or die(mysql_error());
                                                                while($r_gl=mysql_fetch_array($qr_gl,MYSQL_ASSOC)) {
                                                                    if ($r_gl['cognome'] != NULL) {
                                                                        ?&gt;
</code></pre>
<pre><code class="language-php">&lt;?php 
                                                        if ($idmenu == '44') {
                                                            $tipo_medico = '2';
                                                        } else if ($idmenu == '45') {
                                                            $tipo_medico = '1';
                                                        }
                                                        $result=mysql_query($query) or die('Error, seconda query failed');
                                                        $row=mysql_fetch_array($result, MYSQL_ASSOC);
                                                        $numrows = $row['numrows'];
                                                        $maxPage = ceil($numrows/$rowsPerPage);
                                                        // print the link to access each page
                                                        $self = $_SERVER['PHP_SELF'];
                                                        $nav = '';
                                                        for($page = 1; $page &lt;= $maxPage; $page++) {
                                                            if ($page == $pageNum) {
                                                                $nav .= "&lt;strong&gt;&lt;a href='#'&gt;.$page.&lt;/a&gt;&lt;/strong&gt;"; // no need to create a link to current page
                                                            } else {
                                                                $nav .= " &lt;a href=\"$self?page=$page&amp;idmenu=$idmenu&amp;lettera=$lettera&amp;spec=$spec&amp;tipomedico=$tipo_medico\"&gt;.$page.&lt;/a&gt; ";
                                                            }
                                                        }
                                                        if ($pageNum &gt; 1) {
                                                            $page = $pageNum - 1;
                                                            $prev = " &lt;a href=\"$self?page=$page&amp;idmenu=$idmenu&amp;lettera=$lettera&amp;spec=$spec&amp;tipomedico=$tipo_medico\"&gt;&amp;lt;&lt;/a&gt; ";
                                                            $first = " &lt;a href=\"$self?page=1&amp;idmenu=$idmenu&amp;lettera=$lettera&amp;spec=$spec&amp;tipomedico=$tipo_medico\"&gt;[First Page]&lt;/a&gt; ";
                                                        } else {
                                                            $prev  = '&amp;nbsp;'; // we're on page one, don't print previous link
                                                            $first = '&amp;nbsp;'; // nor the first page link
                                                        }
                                                        if ($pageNum &lt; $maxPage) {
                                                            $page = $pageNum + 1;
                                                            $next = " &lt;a href=\"$self?page=$page&amp;idmenu=$idmenu&amp;lettera=$lettera&amp;spec=$spec&amp;tipomedico=$tipo_medico\"&gt;&amp;gt;&lt;/a&gt; ";
                                                            $last = " &lt;a href=\"$self?page=$maxPage&amp;idmenu=$idmenu&amp;lettera=$lettera&amp;spec=$spec&amp;tipomedico=$tipo_medico\"&gt;[Last Page]&lt;/a&gt; ";
                                                        } else {
                                                            $next = '&amp;nbsp;'; // we're on the last page, don't print next link
                                                            $last = '&amp;nbsp;'; // nor the last page link
                                                        }
                                                    ?&gt;
</code></pre>
<p dir="auto">l errore è : Error, seconda query failed<br />
mi potreste dare una mano? grazie a tutti</p>
]]></description><link>https://dev.connect.gt/topic/217702/errore-query</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 09:06:07 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/217702.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Sep 2015 08:01:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to errore query on Tue, 29 Sep 2015 09:44:27 GMT]]></title><description><![CDATA[<p dir="auto">L'errore è nelle query come questa:</p>
<pre><code class="language-php">$query="SELECT COUNT(m.id_albo) AS numrows from medici_odontoiatri where cognome != '' and cognome LIKE '$lettera%'";
</code></pre>
<p dir="auto">Dove non esiste m</p>
]]></description><link>https://dev.connect.gt/post/1208286</link><guid isPermaLink="true">https://dev.connect.gt/post/1208286</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Tue, 29 Sep 2015 09:44:27 GMT</pubDate></item><item><title><![CDATA[Reply to errore query on Tue, 29 Sep 2015 09:35:40 GMT]]></title><description><![CDATA[<p dir="auto">l errore è:<br />
Unknown column 'm.id_albo' in 'field list'</p>
<p dir="auto">grazie</p>
]]></description><link>https://dev.connect.gt/post/1208291</link><guid isPermaLink="true">https://dev.connect.gt/post/1208291</guid><dc:creator><![CDATA[dj]]></dc:creator><pubDate>Tue, 29 Sep 2015 09:35:40 GMT</pubDate></item><item><title><![CDATA[Reply to errore query on Tue, 29 Sep 2015 09:16:49 GMT]]></title><description><![CDATA[<p dir="auto">Ciao,<br />
invece di:</p>
<pre><code class="language-php">$result=mysql_query($query) or die('Error, seconda query failed');
</code></pre>
<p dir="auto">metti:</p>
<pre><code class="language-php">$result=mysql_query($query) or die('Error, seconda query failed: '.mysql_error());
</code></pre>
<p dir="auto">In maniera tale da visualizzare l'errore generato.</p>
]]></description><link>https://dev.connect.gt/post/1208290</link><guid isPermaLink="true">https://dev.connect.gt/post/1208290</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Tue, 29 Sep 2015 09:16:49 GMT</pubDate></item></channel></rss>