completely and utterly stumped

    Date: 03/31/06 (PHP Community)    Keywords: sql

    One would think this is a simple routine. In fact, I used the idential type of routine (while(list() = each()) to assign the very same associative array I'm calling in this method. For the life of me, I cannot figure out why I'm not even getting in the while loop... This is simple, so why am I getting this output? (see below code)....

    //get_sql_insert_string() generates an insert string for the fields ONLY.. tables and criteria still need to be assigned
    	function get_sql_insert_string() {
    		$field_str = "";
    		$value_str = "";
    		echo "testing associateive array with value... " . $this->fields['hex_id'];
    		while (list($key, $value) = each($this->fields)) {
    		echo "why am I not getting in this loop????";
    			if (!in_array($key, $this->get_sql_exclude_fields())) {
    				$field_str .= "'" . $key . ", ";
    				$value_str .= "'" . $value . ", ";
    			}
    		}
    		return " (" . substr_replace($field_str, '', -2) . ") VALUES (" . substr_replace($value_str, '', -2) . ") ";	
    	}


    Here's the output I received....

    testing associateive array with value... 10CE44 () VALUES ()

    It's completely ignoring the loop!!!! Any ideas anyone? I dunno.. maybe I should just step away from the computer for an hour or two. It's probably something simple I'm not seeing.

    Source: http://community.livejournal.com/php/432866.html

« help..please...adding... || Solarisx86 as a hobbiest OS? »


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