huzaifa.iu's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Active Members
Active Posts:
62 (0.07 per day)
Joined:
13-December 10
Profile Views:
1,509
Last Active:
User is offline Apr 18 2013 06:54 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
LandRover
Dream Kudos:
0

Latest Visitors

Icon   huzaifa.iu has not set their status

Posts I've Made

  1. In Topic: Populating Autocomplete List From Database

    Posted 2 Feb 2012

    OK thanks. I got the codes in separate files, and now I even get the print_r($productNames) result as this:
    Array ( [0] => Array ( [0] => Dell Inspiron [product_name] => Dell Inspiron ) [1] => Array ( [0] => SanDisk 8GB [product_name] => SanDisk 8GB ) [2] => Array ( [0] => SanDisk 4GB [product_name] => SanDisk 4GB ) )
    But, the option list is still not getting populated, and shows the same "Array" item instead of the actual name of the item.
  2. In Topic: Attach audio file to an EXE file.....

    Posted 2 Feb 2012

    When you Deploy/Build the EXE file, you can select the resources you want to be deployed along with your program. That way, the MP3 will be copied on the system of whoever runs/installs your EXE file.
  3. In Topic: Populating Autocomplete List From Database

    Posted 2 Feb 2012

    View PostCTphpnwb, on 02 February 2012 - 09:10 PM, said:

    I think you're suffering from the confusion created by mixing HTML and PHP. You need to understand that they're processed on different machines at different times. Mixing them doesn't change that fact.

    When your page is first displayed there is no post value, so PHP calls:
    $productsCrud->GetProductNames("");
    
    

    Oh alright, that gets rid of the "products" index error, but then how do I get the ajax to send the data to the file AFTER the event has been triggered? Cause once the page is loaded, it runs all the script inside I suppose. Please look at the ajax part of my code, do you find any problem in there? I am still learning AJAX so I am not that good at that yet. So if you could guide me it would be great.
  4. In Topic: Populating Autocomplete List From Database

    Posted 2 Feb 2012

    View PostKingCuddles, on 02 February 2012 - 08:41 PM, said:

    Hmm print print_r($productNames) shows nothing? Surly it should show the results from the database as an array.

    I don't see any check to see if $productNames is actually not just an empty result?

    Also try:

    foreach ($productNames as $pN) {
      echo "<option value='" . $pN . "'>" .  $pN . "</option>";
      var_dump($pN);
    }
    
    


    It still didn't show anything. However, I did this change in the function but now I only get the first entry from the database. Other entries are all blank.
    $dsProduct = $db->Execute($query);
    		 $product = array();
    		 $i=0;	        
    
            while($rProduct = $dsProduct ->FetchRow())
            {
            $product[$i] = $rProduct[$i];
    		$i++;			
            }
            
            return $product;
    
    
  5. In Topic: Populating Autocomplete List From Database

    Posted 2 Feb 2012

    View PostKingCuddles, on 02 February 2012 - 08:22 PM, said:

    Can you post the result of print_r($productNames)?

    It doesn't display anything through that statement. But in the resulting input type autocomplete list, it displays a list of "Array" items. But not the actual item names from the database.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Full Name:
Echh Emm

Contact Information

E-mail:
Private

Comments

huzaifa.iu has no profile comments yet. Why not say hello?