');
while ($yarnarray = mysql_fetch_array ($listyarns)) {
printf ('');
printf ('');
$counter++;
if ($counter % 2 == 0) {
printf ("");
$counter = 10;
}
}
And the processing code:
$yarns = "SELECT yarnid FROM yarns";
$yarnidquery = mysql_query ($yarns) or die ("Error at Yarns " . mysql_error() . "\nWhole Query: " . $yarns);
$yarnarraysetup = mysql_fetch_array ($yarnidquery);
$yarnarray = $yarnarraysetup['yarnid'];
while ($yarnidlist = mysql_fetch_array ($yarnidquery)) {
if ($yarnidlist['yarnid'] == $_POST['$yarnarray']) {
//$yarnprice = "INSERT INTO prices (yarnid, storeid, price) VALUES ('$storeidset', $yarnidlist['yarnid'], $_POST['$yarnarray'])";
//$yarnpriceinsert = mysql_query ($yarnprice) or die ("Error at YarnPrice: " . mysql_error() . "\nWhole Query: " . $yarnprice);
}
}
Question 2:
Is there any way to pass variables through an <a href= > tag? I want to set up the ability to browse through stores without having to use all dropdown menus.

Thanks in advance for all of the help.

Source: http://www.livejournal.com/community/php/335388.html

  • Dispaying all dated entries in a DB

    Date: 08/14/05 (PHP Community)    Keywords: mysql, database, sql

    I am trying to display a list of all entries in a blog database. Each entry has a date field, of MySQL type "date", but when I try to display all posts in the database, it only shows posts that have a date on or before the current date. Any post-dated entries do not show up.

    This is the query I am running on the database:

    SELECT * FROM `news` WHERE `date` <= '9999-12-31' ORDER BY `date` DESC, `id` DESC

    I have tried not using a "WHERE" attribute, and also tried "WHERE 1"

    Any suggestions?

    Solved! It was in my post display function. That'll teach me to not pay attention to subfunctions.

    Source: http://www.livejournal.com/community/php/335764.html

  • Ressource id #8

    Date: 08/16/05 (PHP Community)    Keywords: php, mysql, database, sql, google

    $query = "SELECT * FROM users WHERE username = '$username' LIMIT 1;";
    $result = mysql_query($query);
    if ($result) { 
     # deny this user // already in
    }
    else { 
     # add new user
    }
    

    $result ouputs "Ressource id #8." I tried different set of variables in case it could be the problem but everything echo with the correct values. What I'm looking for is: check into the database, if there a equal username already registered. Both tries [with an existant and an unexistant username], it returns the same error. I've looked around either google.com and php.net, it turned on hopeless.

    Can you help me out?

    Source: http://www.livejournal.com/community/php/336854.html

  • Rarg!

    Date: 08/17/05 (SQL Server)    Keywords: database, asp, sql, microsoft

    Okay, so I really have no idea what I'm doing with this, so I'm sorry if this seems kinda dumb.

    I'm trying to install the "Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A" on the computer here, and it seems to install fine.

    I go to the command line and run the setup file with my chosen password. No problem (I hope).

    My end goal is to try and get one of the ASP.NET starter kits to install and think there's a database system on this computer (So I don't have to use MS Access. Ew.), but whenever I go to install the program, I choose the database on the LocalHost, and it gets no connection.

    So, I'm wondering, is there something else I have to do to start up the Desktop Engine and get it running?

    I'm kind of flying blind here, and the read-me doesn't make a whole heck of a lot of sense.

    So, thanks for any help you can give me!

    Source: http://www.livejournal.com/community/sqlserver/31202.html

  • Oko IDDE and DB-manager now shareware

    Date: 08/18/05 (Computer Geeks)    Keywords: programming, database, microsoft

    We have finished testing Oko. It now becomes shareware. You can download an
    evaluation copy and/or purchase a registered copy on-line: www.ploko.net.

    Oko is a development tool for building Windows applications. It uses an
    object-oriented programming language similar to C++ and has a rich set of
    visual tools that
    make application creation a relatively easy and intuitive task. Its
    integrated development environment allows you to create a wide range of
    functional units that can benefit both from the power of the language and
    the versatility of the GUI tools. An efficient code generator makes your
    source code compact and clear and lets you skip many explicit
    initializations. At the same time, code generation is configurable, so that
    you can insert your own code at any level, as well as turn off the automatic
    generation of any of the components.

    Oko has a set of visual database tools that use ODBC to connect to data
    sources. It can generate data forms and provides a set of flexible data
    controls to facilitate the creation of database applications. For many
    tasks, Oko can replace systems such as Microsoft Access generating database
    applications with no programming involved. The advantage of Oko is that its
    applications are very compact, fast, and, of course, stand-alone. It also
    has a built-in report generator.

    Oko produces either Win32 executables or dynamic link libraries (DLLs) from
    which you can export functions to be deployed in any other program. It
    creates stand-alone executables that need no other modules to run.

    www.ploko.net

    Source: http://www.livejournal.com/community/computergeeks/750706.html

  • Database design

    Date: 08/18/05 (SQL Server)    Keywords: programming, database, sql

    As part of my job I use T-SQL, mostly for writing stored procedures. So I'm familiar w/ select/insert/update/delete/cursor/view etc.. But I never created a complicated database or a table schema from scratch. We have a DBA who usually does that.

    Now, our DBA is swamped, so my boss wants me to take a part of our project and design a database for it (to be reviewd by our DBA). While it's flattering that she thinks so highly of my abilities, I feel that I need some serious education before I take this on.

    Please, advise me on a good book on database design!!! Preferably a clearly-written easy-to-read one (think Kernighan & Ritchie's "The C Programming Language ", not Stroustrup's "The C++ Programming Language"). If you don't know an easy-to-read one, a hard-to-read-but-very-informative will do!

    TIA

    Source: http://www.livejournal.com/community/sqlserver/31387.html

  • CMS/Application platforms

    Date: 08/21/05 (PHP Community)    Keywords: cms, database, web

    So I am about to start building a web site/application and I realized that using some form of platform would make my life easier. I have looked at XOOPS as well as ampoliros, Has anyone used these who would like to comment on what they are like to work in. Or if you have another CMS that you like please say something.

    Also Both seem to spend a lot of time showing you how to use an existing module but in neither case could I find anything on how to build your own database drivien components in them.

    Source: http://www.livejournal.com/community/php/338091.html

  • Am I asking for too much?

    Date: 08/22/05 (Web Development)    Keywords: database, web

    I am looking for a script, or whatever, to put on one of my websites that is for links. I would like to be able to put the links into several different categories, and I would like the link database to be searchable by those categories. If at all possible I would like to be able to add other fields to customize it a bit more. I would also prefer open source as opposed to a program that I would have to pay for.

    Am I being too vague, or does that make sense? (I shouldn't be posting at 2 am, probably!)

    Anyhow, I have checked sourceforge to no avail. I do not know of anywhere else to check, as googling it brings up all sorts of other garbage I'm not interested in. Can anyone point me in the right direction?

    Source: http://www.livejournal.com/community/webdev/236915.html

  • Need help with SELECT syntax.

    Date: 08/23/05 (MySQL Communtiy)    Keywords: mysql, database, sql

    Okay, I have a dilemma.

    I'm not sure how to assemble a SELECT query for what I want to do.

    I have a database of ratings for books and movies. Each rating/review is placed into a new row, with a reference number for the item they're related to (actual books and movies are in their own table). and I wish to run a SELECT that will find rating entries for books that have a minimum of 5 entries (ie; 5 rows).

    I'm somewhat of a newcomer to mysql, but I'm not a complete moron. I've been able to set up long and complex query strings, but for some reason, this is befuddling me.

    Any ideas?

    ** EDIT **

    Problem solved, thanks to '[info]'timeimp & '[info]'bobalien

    The resulting query ended up being:

    $query = "SELECT book_reviews.bookid AS idofbook, avg(book_reviews.rating) "
    $query .= "AS nrating, books.bookname AS nameofbook FROM book_reviews,books "
    $query .= "WHERE books.id = book_reviews.bookid GROUP BY book_reviews.bookid "
    $query .= "HAVING count(book_reviews.rating) >= 5 ORDER BY nrating DESC LIMIT 10";

    Source: http://www.livejournal.com/community/mysql/67126.html

  • A resolution of conflicting advice?

    Date: 08/25/05 (Computer Geeks)    Keywords: software, database, virus, spyware, microsoft

    Hello, and bare with me. Computerwise I'm a semi-illiterate seeking an answer to a pre-researched, fairly thought-out question (as advised by the mods in userinfo). The problem is I'm getting conflicting answers depending on where I look, and if you computergeeks can't resolve it, I give up. Hopefully you all are not too disappointed that my question won't involve highly technical jargon or tons of acronyms...

    By way of background: I'm a graduate student in the social science, and for the first time ever I have the opportunity of purchasing a new laptop. I will be storing important research on my computer, as well as doing a great deal of internet research. At some point I will need to install some sort of academic research software (a database that can cross reference scads of quotes, sources, etc.)

    I'm leaning toward a basic mac because I'm hearing that the mac infrastructure is more stable than PCs, and that it is less prone to viruses and spyware. This is important, as viruses ate my last hard drive. On the downside, mac laptops seem to be a bit pricier than comparable PCs. I have never owned a mac before anyway, and have concers about learning a new interface. Additionally, I've been warned by many PC-using faculty and students that e-mailing Word docs (and other Microsoft program stuff) from Mac to PC can be sketchy and that a lot of software is only useable on PC. This can't be true in this day and age, can it?

    If I don't go with a mac, I'll need a good reccommendation for a reliable PC. I've used Dell and Gateway, and had problems with both. I've heard fujitsu is good, but more expensive. I didn't feel I could take this inquiry to the Mac communities, because of their obvious bias. ;)

    Any advice offered will be met with my profound gratitude. Thanks for the patience.

    Source: http://www.livejournal.com/community/computergeeks/756744.html

  • Stuck with XML

    Date: 08/30/05 (PHP Community)    Keywords: php, xml, database


    I have an XML file with a format similar to what follows:


      
          Item Title
          Item Description
          Item Size
         
             ##
             ##
             ##
         

         
             ##
             ##
             ##
         

         
             ##
             ##
             ##
         

       

      
         .
         .
       




    Having never had to parse XML before, I did some searching and found very quickly and easily how to pull information out of the first node, such as a list of titles, descriptions, or sizes, but the data I want to report is:

    Item1: Size, avgMonthlysales
    Item2: Size, avgMonthlysales
    etc.

    preferably with each value in a separate array so they could be easily called as $item[x], $size[x]...

    I'm using PHP5, so I've been working with the simplexml functions, although I have worked with the older xml functions. I haven't figured out how to get the data from the monthlysales under each corresponding item.

    Any pointers as to where I can look for more information on this? Thanks.


    Edit: I'm a little closer, but still need some help. I discovered all of the operators that work with xpath.

    Here's my (borrowed) code:

    $result = $xml->xpath('item/title | item/size | item/monthlysales/avg');
    while (list( ,$node) = each($result)){
    echo $node.'
    ';
    }

    This gives me a very nice
    Item1
    Size
    avgMonthylsales.

    I'd still like to make these into separate arrays because I want to compare them individually with existing database entries, and here is where I'm not smart enough and request help.

    Source: http://www.livejournal.com/community/php/340072.html

  • Active Directory and .NET

    Date: 08/31/05 (C Sharp)    Keywords: database, asp, web

    Hi everybody!

    I have a question about Active Directory in .NET
    For my project I need to fetch results from Active Directory search page by page, because later I would need to bind it to the pageable DataGrid.

    I tried to use .NET library DirectoryServices for that, but paging provided by this library is transparent to the user and is used only to increase the efficiency of searching, when results are too big. I.e. I cannot tell the DirectorySearcher to give me first page, then the next or previous page, it returns me all resulting pages in one bundle.

    However, what I need is to explicitely get page after page directly from the AD searcher and to be able to go at least one page forward or backward.

    The solution with copying all results to the DataBase and then do the paging is not accepeted by the clent, since it is too inefficient. And since it's a Web app, I cannot keep results in memory either.

    I found some hints about COM Interface, but I could not find good and detailed examples or explanations.

    If somebody could help me out with that problem, any suggestion is welcome, 'cause this issue is eating me alive :)

    Thank you!

    x-posted in asp_net

    Source: http://www.livejournal.com/community/csharp/33805.html

  • Restore Database via Script?

    Date: 08/31/05 (SQL Server)    Keywords: database, sql, microsoft

    I use Microsoft SQL Server 2000, for use with Microsoft Great Plains. Right now, I am working on building a backup server, incase the main server goes down (which has happened 2 times in the past 6 months).

    My question is, is there a way to restore a database using a script that could be run from a Windows Command Box (cmd.exe)?

    If you need more information, just let me know.

    Thank you very much,

    Peace,
    Kevin

    Source: http://www.livejournal.com/community/sqlserver/32532.html

  • Adblock list sharing

    Date: 09/03/05 (Mozilla)    Keywords: database

    I was just wondering whether it was possible to share a personal list of blocked sites in adblock? It'd be pretty interesting if it was possible to build up a database of advertising sites - you wouldn't even have to worry about adblocking to begin with, it would already be done for you.

    Source: http://www.livejournal.com/community/mozilla/314495.html

  • can anyone out there???

    Date: 09/04/05 (Computer Help)    Keywords: database

    can anyone out there help me make a database? is it a long arduous process???

    Many thanks in advance

    Source: http://www.livejournal.com/community/computer_help/482210.html

  • zip codes

    Date: 09/07/05 (MySQL Communtiy)    Keywords: php, mysql, html, database, sql

    i'm doing a project where i need to measure distances between zip codes; en route to a solution i stumbled upon a couple of handy resources that i figured i'd pass along:

    http://www.zend.com/codex.php?id=1486&single=1
    a class used to do various zipcode calculations such as distance and finding the zip codes within range of another zip code
    take a look at the class to see how he wants your tables and fields named for the state and zip code database tables

    http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm
    zipbase - datbase of zip codes with lat & long info, state info, etc. available in a text file and an access datbase
    i used the textfile and in mysql said:
    mysql> LOAD DATA LOCAL INFILE 'c:/ZIP_CODES.txt'
    -> INTO TABLE zip_code
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';

    http://27.org/isocountrylist/usps_states_list.sql
    SQL file for creating a states table (i believe in the zipcode class, he wants the states table called "state")

    i used that to make a silly little app to test some of the features of the class:

     $zip){
    		$field = 'zip'.($key+1);
    		if(isset($_REQUEST[$field])){
    			if(is_numeric($_REQUEST[$field])){
    				$zips[$key] = $_REQUEST[$field];	
    			}
    		}
    	}
    	
    	
    
    ?>
    
    " method="GET"> " /> " /> $zip){ if($zip){ echo "
      "; echo "$zip:"; $details = $zc->get_zip_details($zip); if(!empty($details)){ foreach($details as $key => $value){ echo "
    • $key: $value
    • "; } } echo "
    "; } } ?>
    get_distance($zips[0], $zips[1]); } ?>


    oh, and i found this http://centricle.com/tools/html-entities/ to convert app code into HTML special chars



    crossposted in '[info]'php '[info]'mysql & '[info]'bobalien

    Source: http://www.livejournal.com/community/mysql/67585.html

  • zip codes

    Date: 09/07/05 (PHP Community)    Keywords: php, mysql, html, database, sql

    i'm doing a project where i need to measure distances between zip codes; en route to a solution i stumbled upon a couple of handy resources that i figured i'd pass along:

    http://www.zend.com/codex.php?id=1486&single=1
    a class used to do various zipcode calculations such as distance and finding the zip codes within range of another zip code
    take a look at the class to see how he wants your tables and fields named for the state and zip code database tables

    http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm
    zipbase - datbase of zip codes with lat & long info, state info, etc. available in a text file and an access datbase
    i used the textfile and in mysql said:
    mysql> LOAD DATA LOCAL INFILE 'c:/ZIP_CODES.txt'
    -> INTO TABLE zip_code
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';

    http://27.org/isocountrylist/usps_states_list.sql
    SQL file for creating a states table (i believe in the zipcode class, he wants the states table called "state")

    i used that to make a silly little app to test some of the features of the class:

     $zip){
    		$field = 'zip'.($key+1);
    		if(isset($_REQUEST[$field])){
    			if(is_numeric($_REQUEST[$field])){
    				$zips[$key] = $_REQUEST[$field];	
    			}
    		}
    	}
    	
    	
    
    ?>
    
    " method="GET"> " /> " /> $zip){ if($zip){ echo "
      "; echo "$zip:"; $details = $zc->get_zip_details($zip); if(!empty($details)){ foreach($details as $key => $value){ echo "
    • $key: $value
    • "; } } echo "
    "; } } ?>
    get_distance($zips[0], $zips[1]); } ?>


    oh, and i found this http://centricle.com/tools/html-entities/ to convert app code into HTML special chars



    crossposted in '[info]'php '[info]'mysql & '[info]'bobalien

    Source: http://www.livejournal.com/community/php/341574.html

    1. Can anyone figure out why the following wont work

      Date: 08/09/05 (MySQL Communtiy)    Keywords: browser, database

      it keeps throwing errors



      /*********

      postings & comments database structure
      written by : that intern

      *********/

      CREATE DATABASE if not exists commentsDB;
      USE commentsDB;

      DROP TABLE IF EXISTS `userDB`; /* works fine! */
      CREATE TABLE `userDB` (
      `userID` INT NOT NULL AUTO_INCREMENT,
      `username` varchar(8) NOT NULL,
      `userpass` VARCHAR(8) NOT NULL,
      `first_name` VARCHAR(10) NULL,
      `last_name` VARCHAR(15) NULL,
      `address_1` VARCHAR(25) NULL,
      `address_2` VARCHAR(15) NULL,
      `city` VARCHAR(18) NULL,
      `state` VARCHAR(2) NULL,
      `zip_code` TEXT NOT NULL,
      `email` VARCHAR(25) NOT NULL,
      `gender` VARCHAR(1) NULL,
      PRIMARY KEY (`userID`)
      ) TYPE=InnoDB;

      DROP TABLE IF EXISTS `userInfo`;
      CREATE TABLE userInfo (
      `browser` VARCHAR(255) NULL,
      `userIP` TEXT NULL,
      `userOS` varchar(255) default NULL,
      `pages_visited` varchar(255) default NOT NULL,
      `last_login` varchar(255) default NOT NULL, /* works until here */
      PRIMARY KEY (`userID`),
      FOREIGN KEY (`userID`) FROM userDB(`userID`)
      ) TYPE=InnoDB;

      DROP TABLE IF EXISTS `post`; /* works fine! */
      CREATE TABLE `post` (
      `post_num` INT(15) NOT NULL,
      `post_text` TEXT NOT NULL,
      `post_cat` VARCHAR(10) NOT NULL,
      `post_time` TIMESTAMP NOT NULL,
      `post_date` DATE NOT NULL,
      `post_user` VARCHAR(15) NOT NULL,
      PRIMARY KEY (`post_num`)
      ) TYPE=InnoDB;

      DROP TABLE IF EXISTS `comments`;
      CREATE TABLE `comments` (
      `comment_text` TEXT NULL,
      `comment_time` TIMESTAMP NOT NULL,
      `comment_date` DATE NOT NULL,
      `userIP` TEXT NOT NULL /* works until here */
      post_num INT,
      userID INT,
      FOREIGN KEY (post_num) REFERENCES post(post_num),
      FOREIGN KEY (userID) REFERENCES userDB(userID)
      ) TYPE=InnoDB;

      Source: http://www.livejournal.com/community/mysql/66303.html

    2. The Holy Grail of PHP

      Date: 08/09/05 (PHP Community)    Keywords: php, database, sql, web

      Thought I'd share this with the community. I'll be writing a real walkthrough soon, as this combo is too good to keep to myself.
      Would love to hear any comments, criticisms, or alternatives. If anyone is interested in helping write a few pages on the topic, send me an email or something too.


      What do you get when you combine an automated database object abstraction layer, an embedded templating engine, and an AJAX library?

      Unparalled rapid modular development fusing the web's hottest technologies.
      And it's easy.

      PEAR DB_DataObject
      PHP Smarty
      xajax

      What's it look like? Here's a teenie example.

      index.php

      
      
      
      
      	
      		printJavascript(); ?>
      		Test
      	
      	
      		
      ID:



      ajax.php
      addAssign("content","innerHTML", $v->getNote($id));
      
      	return $objResponse->getXML();
      }
      
      $xajax = new xajax();
      
      $xajax->registerFunction("getNote");
      $xajax->processRequests();
      ?>



      template.php
      template_dir = 'tpl/';
      		$this->compile_dir = 'tpl/comp';
      		$this->config_dir = 'tpl/conf';
      		$this->cache_dir = 'tpl/cache';
      	}
      
      	function getNote($id = null) {
      		$note = DB_DataObject::Factory('notes');
      		$note->get($id);
      		$this->assign('note', $note);
      		return $this->fetch('note.tpl');
      	}
      }
      ?>



      tpl/note.tpl
      {$note->name}
      {$note->body}



      data.php



      schema.sql
      CREATE DATABASE organizer;
      USE organizer;
      
      CREATE TABLE notes (
      	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
      	name VARCHAR(32),
      	body TEXT,
      	PRIMARY KEY(id)
      );




      Source: http://www.livejournal.com/community/php/333380.html

    3. What should we give the Tuxmasters?

      Date: 08/12/05 (Open Source)    Keywords: database

      An interesting press release came in from the folks at Clarkson University today. (Go Golden Knights.) It celebrated the victory of grad students Todd M. DeShane and Patricia A. Jablonski in the second TuxMasters competition, sponsored by Unisys and the OSDL. Another Clarkson team finished second.The winning entry was a database project, a system for [...]

      Source: http://blogs.zdnet.com/open-source/?p=407&part=rss&tag=feed&subj=zdblog

    4. Two Questions

      Date: 08/13/05 (PHP Community)    Keywords: php, mysql, database, sql, web

      [Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]

      Hi everyone. I am new to the group, and also relatively new to PHP. I have two questions relating to a website that I am setting up. Brief description:
      This is a website that lists reviews of yarn stores. Included in the information that it captures is the price of certain yarns.
      Question 1:
      If I am using an array to call the &lt;input name = xyz&gt;, how do I write my insert statement to use it?
      This is what I have so far, but I am very skeptical that it would work:

      The form code:
      $dbh=mysql_connect ("host", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
      mysql_select_db ("knittin1_yarnstore");
      $getyarns = "SELECT yarnid, yarnco, yarnname FROM yarns";
      $listyarns = mysql_query ($getyarns) or die ("Error at ListYarns: " . mysql_error() . "\n Whole Query: " . $getyarns);
      $counter = 10;
      printf ('
    ' . $yarnarray['yarnco'] . " " . $yarnarray['yarnname'] . '$
    Previous page  ||  Next page


    antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home