
1bigbear
Members-
Posts
33 -
Joined
-
Last visited
Never
Everything posted by 1bigbear
-
I can't find a way of starting the foreach loop from a certain array, I have an array with 1000 values, and I want to start the loop with the 500th value, skipping the first 500, is this possible?
-
It is not that simple you need to login before you post and posting the image is complicated is xml, why don't they use php like the normal people do?
-
Is there a simple way of uploading an image to Picasa and then getting the link to the image? I haven't found anything to do this.
-
I need to use a database, and I haven't found a better way
-
I have to build a script that will perform a certain actions at specified intervals, and I don't know how to do it. I have a list of events something like her: walk every 30 minutes run every 10 minutes talk once a day sit once a week I have four actions that need to be performed at different intervals, I have in a database the time when the task was last performed, the interval, and the future time when the action must be performed. Because I can't use cron I am thinking of using a page that reloads every 1 minute as the clock to compare the actual time with the all tasks future time, if they are equal or future time is lower that the actual time then perform the task. What do you think is this a good method or there are more simple ways of doing this?
-
thanks, both scripts work
-
I am trying to get text from an array, that has 100 words. I want to get two or three random words from the array, what to use to do this? $text= array(one,two, three, things,stuff);
-
I got some text, and in the text there are a couple of javascripts, <script language='JavaScript' type='text/javascript' src='http://site.com/gfsdgf.js'></script> <script language='JavaScript' type='text/javascript'></script> <noscript><a href=''></a></noscript> And <script language="JavaScript"> flowplayer('in_tvPlayer_0',{ durationColor: '',}); </script> How can I remove only this javascripts, and keep the rest of the text?
-
I found this $sql="SELECT * FROM data order by id desc limit 10"; but what to use so that query gets only the id that is lower that 1000?
-
I am trying to get 10 entries from a database, but how to do this, the entries have an id number if I take them according with the id number some problems will appear when I delete some of the entries. What to do?
-
[SOLVED] Cannot redeclare function in foreach
1bigbear replied to 1bigbear's topic in PHP Coding Help
Your right thanks -
Hi, I have a foreach $verify="a"; foreach ($value as $each) if ($each == $verify) { function strange( $text) { // do something } }} the error: Fatal error: Cannot redeclare strange But I have to use the strange function on each iteration of the array. How to solve this problem?
-
I got it working but how to use it in a mysql query $verify="a"; foreach ($value as $each) if ($each == $verify) { print_r ($each); } But how to use it in the search script, to take each name and search, becasue I have to take a value from the array to compare with the database $crit='client'; switch($crit) { case 'client': $sql="select * from client where client.name like '%".$value."%'"; $rez=mysql_query($sql); while($rd=mysql_fetch_array($rez)) { $seno=$rd['value']; } $reswwwult = mysql_query($sql) or die(mysql_error()); }
-
so it will work automatically, I just have to give write foreach ($name as $each){ if ($each == $databasename){ //do whatever } else { //do whatever else } } and $each will take the next value of the array until it reaches the end? and I dont have to use auto increment?
-
what is $each? what is it do? does it take take a value from the array? and how to make it take the value of $name[0][1]?
-
to search it is using a mysql_query, This is how it work: and it continues. I want to modify the script so that the script has only one if, something like this:
-
I have build a script that is very long and because of this it has problems. The script searches a data base and does something if it finds it. But it has to verify multiple values and I have written the code manually for each one. I want to modify the script so that it is searching a value and them move to the next using auto increment. How to do this?
-
I having a problem with WP, I have a script that sends post via e-mails but WP doesn't put the post in the right category. I use WP 2.8.5. I use the right tags [category movie] but it doesn't post in the right category.
-
I having a problem with WP, I have a script that sends post via e-mails but WP doesn't put the post in the right category. What is the problem?
-
The array $val has this data Array ( [0] => Array ( [name] => John ) [1] => Array ( [name] => Dan ) [2] => Array ( [name] => Jim ) ) And I want to use the content of $val[1][1] that is Dan, but the script that I use needs a string not a array And I don't know how to convert the array $val[1][1] to string
-
what do I put instead of 'lastname', 'email', 'phone' I don't have that?
-
could you explain?
-
I want to use the data from $val[1][1] in another place but it needs to be a string
-
How to use <?php $array = array('lastname', 'email', 'phone'); $comma_separated = implode(",", $array); echo $comma_separated; // lastname,email,phone ?>
-
I am having problems converting this array to a string using print_r($val[1]); I get: Array ( [0] => Array ( [name] => John ) [1] => Array ( [name] => Dan ) [2] => Array ( [name] => Jim ) ) I have tried several methods but they don't work