Results 1 to 12 of 12

Thread: Loop doesn't seem to be working for me in my AWS script

  1. #1
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68

    Loop doesn't seem to be working for me in my AWS script

    In this:
    PHP Code:
    $ArraySearchString = array(
                                 
    497024 => "Web Development",
                                 
    229614 => "Graphics",
                                 
    497022 => "Video & Music"
                            
    ); 
    I'm trying to use a loop to eacho the node and name from my database and have tried doing it like so:
    PHP Code:
    $ArraySearchString = array(
                            while(
    $row mysql_fetch_array($result1)){
                                echo(
    $row['amazonid'] =>."".$row['name'].",");
                            }     
                            ); 
    But I get a parse error on this row:
    PHP Code:
    while($row mysql_fetch_array($result1)){ 
    Anyd ideas?

  2. #2
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    You don't need those mysql functions, your BrowseNodes are stored in an array, not in a database.

    Echo the array like this:
    PHP Code:
    foreach($ArraySearchString as $key => $value){
      echo 
    $key', ' .$value;

    ....

  3. #3
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68
    That's what I'm saying...i'm trying to populate the array with the correct nodes and category titles. And my database has the nodes and category titles.
    Josh.

  4. #4
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    If your data is stored in the database, you don't need to re-create the $ArraySearchString array.
    ....

  5. #5
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68
    Hmm...well I'm using the tutorial you wrote...so in aws-functions.php...what goes in $ArraySearchString?
    PHP Code:
    $ArraySearchString = array(

    #what goes here#                        
         
                            
    ); 
    Josh.

  6. #6
    Registered
    Join Date
    Jan 2004
    Posts
    224
    I'm storing the nodes in a database and I don't have anything under $ArraySearchString. You won't need it unless you want to echo that variable instead of the database.

  7. #7
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68
    Originally posted by MattM
    I'm storing the nodes in a database and I don't have anything under $ArraySearchString. You won't need it unless you want to echo that variable instead of the database.
    Well...for instance, in browse.php this code:
    PHP Code:
    if(!isset($ArraySearchString[$Browse])){ 
    i'm assumign i just need to remove that?

  8. #8
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    In the tutorial I used an array to store the BrowseNode info for a handful of reasons. If your BrowseNode info is stored in a database then you'll have to find each instance of $ArraySearchString and update it to pull the data from the database instead.
    ....

  9. #9
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68
    Ah...ok...
    Josh.

  10. #10
    Registered
    Join Date
    Jan 2004
    Posts
    224
    I didn't explain correctly on my part - I updated it to pull the data from the database instead.

  11. #11
    Baaaahhhh RockNRollPig's Avatar
    Join Date
    Feb 2004
    Location
    Denver, CO
    Posts
    68
    Originally posted by MattM
    I didn't explain correctly on my part - I updated it to pull the data from the database instead.
    That's what I've been trying to do from the start...and it wasn't working. Are you saying you updated $ArraySearchString to pull it's info from the database? If so...how?

  12. #12
    Registered GCT13's Avatar
    Join Date
    Aug 2003
    Location
    NYC
    Posts
    480
    AutomatikStudios, if you don't have a lot of BrowseNodes you may want to use the array setup for now for whatevery site you're working on. That'll give you time to work on the database setup.
    ....

Similar Threads

  1. Dan's AWS Script
    By mobilebadboy in forum Advertising & Affiliate Programs
    Replies: 13
    Last Post: 05-08-2004, 03:14 PM
  2. AWS PHP script problems
    By tempyyyst in forum Advertising & Affiliate Programs
    Replies: 8
    Last Post: 04-04-2004, 07:12 AM
  3. Anybody found a shopping cart script to use with AWS?
    By RockNRollPig in forum Advertising & Affiliate Programs
    Replies: 7
    Last Post: 02-18-2004, 06:44 PM
  4. script help
    By k0r54 in forum HTML, CSS, Layout, and Design
    Replies: 1
    Last Post: 11-23-2003, 09:16 PM
  5. Redirect script with statistics, graphs, etc
    By emke in forum Website Programming & Databases
    Replies: 7
    Last Post: 05-20-2003, 03:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •