-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
[SOLVED] Looking for Solution / Workaround for Preg_Match with Array as Subject
.josh replied to mr.rum's topic in Regex Help
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. -
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.
-
he's obviously psychic.
-
SA you are a buzzkill. You totally coulda fucked with his head.
-
-
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?
-
Unknown PHP error (2) mysql_connect() [function.mysql-connect]
.josh replied to Trek15's topic in PHP Coding Help
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... -
Unknown PHP error (2) mysql_connect() [function.mysql-connect]
.josh replied to Trek15's topic in PHP Coding Help
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. -
Unknown PHP error (2) mysql_connect() [function.mysql-connect]
.josh replied to Trek15's topic in PHP Coding Help
print_r($processed); does that print out expected info? Usually for localhost you just need 'localhost' not 'blah@localhost' -
have to agree with cags though...if you're looking for an exact match, strstr or stristr or strpos or stripos would be better.
-
preg_quote
-
[SOLVED] getting only HOTMAIL users' emails and NOT Yahoo?
.josh replied to samoi's topic in Regex Help
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. -
[SOLVED] getting only HOTMAIL users' emails and NOT Yahoo?
.josh replied to samoi's topic in Regex Help
don't even need sql regex... select * from table where email like '%@hotmail.com' -
It's not, but it greatly increases your chances of actually getting said help.
-
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...
-
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..)
-
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}%'
-
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...
-
No but I hear the 89 can run the latest pokemon games
-
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 .
-
Why do some search forms record the mouse x and y coordinates?
.josh replied to daydreamer's topic in Miscellaneous
we're just numbers man! -
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'; } }
-
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.
-
Also, unless you just c/p'd wrong, you are missing a ; on the end of the last line posted.