Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Your problem is that $all_articles is a multi-dim array and you are looping through the top level. Do this: echo "<pre>"; print_r($all_articles); So you can see the hierarchy of results. alternatively, considering you are using tags to mark your content, you might want to consider using DOM or XML instead.
  2. Anyways, I wouldn't pay $50 for that. I wouldn't even pay $5. That looks like a cheap ass banner on some link farm site, dedicated to pushing "as seen on tv" wares.
  3. he's obviously psychic.
  4. SA you are a buzzkill. You totally coulda fucked with his head.
  5. what does your query string look like? Spell the fields right (case sensitive even)? How do you know the other arrays do not contain it? Where are you outputting them?
  6. I have no idea what script you are using. You can tell me if you like, but I'm not going to go searching for it and then look over its code.. more than likely it simply doesn't accept non-alphanumeric chars in things like username, pw, etc...
  7. put it in your script just above $connection = @mysql_connect($processed['db_server'], $processed['db_user'], $processed['db_passwd']); and run it. You should see info about your $processed array output on the screen.
  8. print_r($processed); does that print out expected info? Usually for localhost you just need 'localhost' not 'blah@localhost'
  9. have to agree with cags though...if you're looking for an exact match, strstr or stristr or strpos or stripos would be better.
  10. preg_quote
  11. all of the preg_xxxx functions use the same pcre regex engine. If anything, preg_replace is the more complicated one, as it allows you to eval the replacement.
  12. don't even need sql regex... select * from table where email like '%@hotmail.com'
  13. It's not, but it greatly increases your chances of actually getting said help.
  14. hmm not sure if OP wants nested, but rather same level looping. If the array keys are the same, you can do this: foreach($array1 as $key => $val) { echo $val; // echo current $array1 value echo $array2[$key]; // echo current $array2 value } if one is a numeric array ($array1) and one is an associative array ($array2), you can do this: $key = 0; foreach ($array2 as $val) { echo $val; // echo current $array2 (associative) value echo $array1[$key]; // echo current $array1 (numeric) value $key++; } If they are both associative but have different keys, you can do this: foreach ($array1 as $val) { echo $val; // echo current $array1 value echo current($array2); // echo current $array2 value next($array2); } of course, all of these examples assume that both of the arrays have the same number of elements...
  15. hmmm....while my coding techniques do continually improve, my coding "style" (comment convention, indentation, etc..) has not really changed in a very long time. In my own experience, and experience in seeing other people's code, people pretty quickly figure out what works best for them and generally stick to it (for better or worse..)
  16. so what happens when the user doesn't have an @yahoo.com address? You would need to in your query that checks the user name, instead of doing ...where user = '$username' you would do ...where user like '{$username}%'
  17. $url = "http://www.somesite.com/read.php?1,2,2,4,5"; $url = basename($url); preg_match('~^[^,]+(?:,[^,]+)?~',$url,$match); echo $match[0];
  18. .josh

    Hello!

    well if you're rating based off knowledge, then sure. But if you rate based off general problem solving skills and ability to get shit done...
  19. No but I hear the 89 can run the latest pokemon games
  20. the TI-89 is obviously better, as it is "89" whereas the TI-84 is only "84" and 89 is more than 84. I actually did that math in my head, so I don't see how either one of those would be useful IMO .
  21. But is it set up to make it null by default? Anyways, dunno how you have your form setup but in general you could just for instance loop through the $_POST array. foreach($_POST as $key => $value) { if (trim($value) == '') { $_POST[$key] = 'null'; } }
  22. ah yah true forgot about that technicality. You can use basename to get just the image name or just remove $imgdr from the src="..." altogether.
  23. Also, unless you just c/p'd wrong, you are missing a ; on the end of the last line posted.
×
×
  • 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.