IT Community - Software Programming, Web Development and Technical Support

Comparing Values

This is a discussion on Comparing Values within the PHP Programming forums, part of the Web Development category; ok, well ive managed to build 2 little scripts, 1 that lists all the themes for a cms that are ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-24-2007, 01:06 AM
pranky pranky is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 51
pranky is on a distinguished road
Default Comparing Values

ok, well ive managed to build 2 little scripts, 1 that lists all the themes for a cms that are located in a certian directory, and another script that lists all the themes for a cms that have been added to a the database. however, what i want to do, is have a list that shows all the themes in the directory that have not been added to the database yet.


Lists all the themes in the themes folder:
PHP Code:
PHP Code:
$dir "../themes/";
if (
is_dir($dir)) {
   if (
$dh opendir($dir)) {
       while ((
$file readdir($dh)) !== false) {
            if(
file_exists("../themes/$file/theme.php")){
           
$themelist .= "$file ";
            }
       }
       
closedir($dh);
   }
}
$themelist explode(" "$themelist);
sort($themelist);

for (
$i=0$i sizeof($themelist); $i++) {
if(
$themelist[$i]!=""){

echo 
$themelist[$i] . "<br>";

}

Lists all the themes that have been added to the database:
PHP Code:
PHP Code:
$q "SELECT * FROM nuke_theme_preview";
$result mysql_query($q) or die ('Something is wrong with query: ' $q '<br>'mysql_error());
while (
$row mysql_fetch_assoc($result))
{
echo 
$row['t_title'] . "<br>";

What i want done is something that will list all the themes in the directory that are not in the database. I believe I have to use the IN ( ) MySQL construct, but i have no idea how to format the syntax. could someone give me a hand

Thank You.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two Dates Kirubhananth ASP and ASP.NET Programming 4 03-25-2008 09:46 PM
How to get values from querystring? S.Vinothkumar Ruby 2 11-26-2007 06:40 AM
What is the result of comparing NULL with NULL? vijayanand Database Support 1 09-20-2007 07:07 AM
How do I retrieve the values from the URL? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-13-2007 06:30 AM
Which TSL functions you will use for Comparing the text? senthilkannan Testing Tools 0 07-30-2007 03:05 AM


All times are GMT -7. The time now is 06:08 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0