Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

About emehrkay

Profile Information

  • Gender
    Not Telling

emehrkay's Achievements

Regular Member

Regular Member (3/5)



  1. mine phonetically says "mark," my name Em = M Eh = A R = R kay = K I thought of it in the 90's. It was my first aol(lol) name and has been with me since. I even have emehrkay.com registered and it may be incorporated soon :)
  2. thanks ober you always come through in the clutch, like kobe or mj. yeah i think the brackets is a habit, and i like to see my code done that way. oh, most importantly, its a standard at my job - lol
  3. i have this object [code] Array (     [0] => stdClass Object         (             [first_name] => Jennifer             [last_name] => Masi             [person_id] => 1309         )     [1] => stdClass Object         (             [first_name] => Roy             [last_name] => Mc             [person_id] => 2469         ) ) [/code] now i want loop through that and put the person_id as the key and first & last names as the value. i tried array_push, but i dont think you can define what the key will be with that function. is there any way for me to do this? my current line of thinking ($this->_data_contact is the object): [code] $con_count = count($this->_data_contact);                  $con_arr   = array($arr_val);         for($i = 0; $i < $con_count; $i++){             array_push ($con_arr, $this->_data_contact[$i]->person_id."=>".$this->_data_contact[$i]->first_name." ".$this->_data_contact[$i]->last_name);         } [/code] that only creates [0]=>"id=>first last" [1]=>"id=>first last"
  4. so i finally decided to be an adut and put the basic queries into a class and i decided the way that i will parse the data will be from an array. i created a method that will take the array passed in and create the approriate string. and from that string there will be a trailing comma, so i created another method to remove that comma. that works fine for all of the cases in this switch except the "SELECT_FIELDS" one this is how i call the class and method [code] $arr = array("id","name"); $tables = array("test"); $where = ''; $t = new db_calls('test'); $t->select($arr, $tables, $where); [/code] these are the select and result methods [code] public function select($fields, $tables, $where){              $this->parse_array($fields, "SELECT_FIELDS");         $this->parse_array($tables, "SELECT_TABLES");                          if($where != ''){             $where_clause = "WHERE " . $where;         }else{             $where_clause = "";         }                  $query = "SELECT " . $this->_db_fields . " FROM " . $this->_db_tables . $where_clause;         return $this->result($query);     }          private function result($query){         $result = mysql_query($query)         or die ("<h2>COULD NOT EXECUTE QUERY:</h2><span style=\"color:red;\">".$query."</span><br /><br />".mysql_error());     } [/code] this is the parse array method and remove comma method [code] public function parse_array($arr, $method){         foreach($arr as $key => $value){             switch($method){                 case "INSERT":                     $this->_db_data   .= $this->numeric($value) . ", ";                     $this->_db_fields .= $key . ", ";                     break;                 case "SELECT_FIELDS":                     $this->_db_fields .= $value . ", ";                     break;                 case "SELECT_TABLES":                     $this->_db_tables .= $value . ", ";                     break;             }         }                  if($this->_db_data != '')   $this->_db_data   = $this->remove_comma($this->_db_data);         if($this->_db_fields != '') $this->_db_fields = $this->remove_comma($this->_db_fields);         if($this->_db_tables != '') $this->_db_tables = $this->remove_comma($this->_db_tables);              }               /*     *         *    REMOVE TRAILING COMMA FROM A STRING     */     public function remove_comma($string){         $len = strlen($string) -2; //substract two because of the way the comma is added: ", "         return substr($string, 0, $len);             }[/code] this is what is printed to the screen [code] COULD NOT EXECUTE QUERY: SELECT id, na FROM test Unknown column 'na' in 'field list'[/code] what am i overlooking? for some reason the fields var is removing four chars instead of two.
  5. [!--quoteo(post=342362:date=Feb 3 2006, 07:16 AM:name=jcombs_31)--][div class=\'quotetop\']QUOTE(jcombs_31 @ Feb 3 2006, 07:16 AM) [snapback]342362[/snapback][/div][div class=\'quotemain\'][!--quotec--] I guess I could just post a microsoft word document and that would make a geat site then... Afterall, Microsoft does a great job of formatting my text. I didn't recall mentioning flash and pizazz, but you are right, various font sizes and text colors certainly doesn't acheive it... [/quote] i suggest that you take another look at that site. i've seen your work and its great! but if you can not look at this site and see why it is good, than i really cant explain it to you
  6. [!--quoteo(post=342093:date=Feb 2 2006, 01:14 PM:name=jcombs_31)--][div class=\'quotetop\']QUOTE(jcombs_31 @ Feb 2 2006, 01:14 PM) [snapback]342093[/snapback][/div][div class=\'quotemain\'][!--quotec--] simple is an understatement. It's just a bunch of text. I also absolutely no idea what this site is about. There really isn't much of anything going on. [/quote] i disagree. design is not all about flash and pizazz. simplicity is design and i think he has done a great job using it. look at the varying font sizes and colors and then the rollover colors. i think this is good work.
  7. [a href=\"http://getvanilla.com/\" target=\"_blank\"]http://getvanilla.com/[/a]
  8. emehrkay


    oh yeah, this is the best looking site on the front page of website critique id say hook yourself up with a favicon and you're gold. and look into the ajax thing, god is cool. ajax - http://www.webpasties.com/xmlHttpRequest/ favicon - http://www.thesitewizard.com/archive/favicon.shtml warn when a link, the one on the nav bar, is a pdf. the subbuttons with the black bg really throw off the great color flow that you've created. add some pictures!!! great looking site though, keep up the good work
  9. emehrkay


    i begin lookin into it as well, crazy stuff - thats how i found this thread doing a search for xmlhttprequest
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.