[56k Warn] "SELECT DISTINCT" and the "NOT LIKE"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
randall
Forum Newbie
Posts: 16
Joined: Fri May 08, 2009 9:01 pm

[56k Warn] "SELECT DISTINCT" and the "NOT LIKE"

Post by randall »

Been battling this, I think the "SELECT DISTINCT" and the "NOT LIKE" statements are conflicting... I think...

Code: Select all

 
<?php include "inc/connect.php" ?>
<?php
$nav = mysql_query("SELECT DISTINCT a_cat.category_name
FROM a_cat 
WHERE a_cat.catStatus=1 
AND `fileName` NOT LIKE CONVERT( _utf8  'NEW-PRODUCTS, 0%' USING latin1 ) COLLATE latin1_swedish_ci");
?>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr> 
<td><table width="100%"  cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        
<tr>
          <td width="2"><img src="images/spacer.gif" width="1" height="12" /></td>
          </tr>
        <tr>
          <td align="center" valign="middle"><table width="100%" height="1" border="0" cellspacing="0" cellpadding="0">
 
<?php
while ($data = mysql_fetch_array($nav))
{ ?>
            <tr> 
              <td align="center" valign="middle"><img src="images/diamond.png" width="11" height="13" /></td>
            <td>&nbsp;</td>
            <td align="left"><a STYLE="text-decoration:none" href="categories.php?catid=<?=$data["subCatID"]?>"><font color="#393833" size="2" face="Verdana, Arial, Helvetica, sans-serif"><?=$data["catName"]?></font></a></td>
          </tr>
            <tr> 
              <?
}
?>
              </table><?php end ?></td>
          </tr>
        <tr> 
          <td><img src="images/spacer.gif" width="1" height="12" /></td>
          </tr>
      </table>
</td>
</tr>
</table>
<?php end ?>
<br>
 
 

Image
Attachments
categories.png
categories.png (60.82 KiB) Viewed 225 times
Last edited by Benjamin on Sat May 16, 2009 10:23 am, edited 1 time in total.
Reason: Changed code type from text to php. Added 56k Warn.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: [56k Warn] "SELECT DISTINCT" and the "NOT LIKE"

Post by Mark Baker »

You're not saying what the problem is but

Code: Select all

SELECT DISTINCT a_cat.category_name
should be

Code: Select all

SELECT DISTINCT a_cat.catName
based on your database table images

Though is it supposed to return any records?
randall
Forum Newbie
Posts: 16
Joined: Fri May 08, 2009 9:01 pm

Re: [56k Warn] "SELECT DISTINCT" and the "NOT LIKE"

Post by randall »

Thx, :crazy:
Post Reply