Monkeymatt
-
Posts
35 -
Joined
-
Last visited
Never
Posts posted by Monkeymatt
-
-
Your problem with the second query was that when the where was correct once, it did not only change that row, but it changed every row if the where was right at least once.
Monkeymatt -
This will also check if those characters are in the string.
[code]
if (strpos('@', $str) !== false || strpos('.', $str) !== false || strpos(' ', $str) !== false) {
// space, period, or @ found
}
[/code]
Monkeymatt -
Here's a way to search for state:
[code]
<?php
// Let's say $str = the sample you posted
// And $state is the state you want to search for
$tmp_array = explode("\n", $str);
foreach ($tmp_array as $value) {
$curr = explode("|", $value);
// check for whatever you want here
if ($curr[7] == $state) {
// print it out however you like
echo "<pre>";
print_r($curr);
echo "</pre>";
}
}
?>
[/code]
You could simply extend that to search for other things.
Monkeymatt -
How is this flatfile database configured -- what do the rows look like?
-
$this->level_tracker[$i]['****code****'] is the data from a template file. I want to be able to pull all the stuff out of between <{loop_(section name)}> and <{/loop_(section name)}> not matter what is in there. Currently, preg is not matching any of the sections for me.
-
How do I convert this eregi matching to preg, it works in eregi, but I can't get it to work in preg:
[code]
eregi("<{loop_".$section."}>(.*)<{/loop_".$section."}>", $this->level_tracker[$i]['****code****'], $contents);
[/code]
Here is the preg_match I tried, which does not work:
[code]
preg_match('|<{loop_'.$section.'}>(.*)<{/loop_'.$section.'}>|iU', $this->level_tracker[$i]['****code****'], $contents);
[/code]
Any help would be appreciated.
Monkeymatt
Image in database
in PHP Coding Help
Posted
I would suggest moving away from images in databases if possible, but if you want to stay with images in databases, inserting a thumbnail into the database would most likely be significantly quicker while not taking too much extra space.
Monkeymatt