-Original Message-
From: Andrew Williams [mailto:andrew4willi...@gmail.com]
Sent: 27 March 2009 10:12 AM
To: PHP LIST
Subject: [PHP] WHILE LOOP PROBLEM
can some tell why the below loop stop running after some time.
$start=10;
const run=0;
while($start >run){
//do somthing
}
--
The we
On Fri, 2009-03-27 at 08:11 +, Andrew Williams wrote:
> can some tell why the below loop stop running after some time.
>
> $start=10;
> const run=0;
> while($start >run){
>
> //do somthing
>
> }
>
max_execution_time
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Reinhart Viane wrote:
Well I'm able to do that, there are only 4 different types, but the 4
queries have exactly the same syntax so I think it's better to combine them.
Not?
what about using UNION on the four queries?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
ijk bericht-
Van: Justin Lilly [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 23 februari 2005 18:57
Aan: php-general@lists.php.net
Onderwerp: Re: [PHP] while loop
Perhaps it is just me, but wouldn't it be easier to make individual
mysql queries for each different act type? That would make the s
hp-general@lists.php.net
Onderwerp: Re: [PHP] while loop
Perhaps it is just me, but wouldn't it be easier to make individual
mysql queries for each different act type? That would make the sorting
-much- easier. I'm not sure if that's an option, but if it is, I'd
consider exploring
Perhaps it is just me, but wouldn't it be easier to make individual
mysql queries for each different act type? That would make the sorting
-much- easier. I'm not sure if that's an option, but if it is, I'd
consider exploring it.
select * from activities where act_date >= NOW() && act_type_id = 1
Reinhart Viane wrote:
> Hey list
>
> I have a mysql table like this:
>
> Act_name Act_type_id Act_date
>
> Heyhey 1 22-06-05
>
> Aloha2 22-06-05
>
> Tralala 2 22-06-05
>
> Wuhu
Reinhart Viane wrote:
Hey list
I have a mysql table like this:
[ snipped ]
Now I retrieve all activities happening in the future with this query:
$sqlact="select * from activities where act_date >= NOW() order by
act_type_id”;
$getact=mysql_query($sqlact)
What I’m trying to do now is:
F
Hi,
Monday, March 10, 2003, 7:20:37 PM, you wrote:
RK> Can somebody look at this and tell me way the first while loop will
RK> only loop through the database once when there is more than one record
RK> that should be processed.
RK> while($members = @mysql_fetch_object($result)) {
RK> $logged_
> -Original Message-
> From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 11:57 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] while loop- will this work?
>
>
>
>
> Should this work?
Nope...because the value returned by mysql_query() isn't the
> -Original Message-
> From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] while loop- will this work?
>
>
>
>
> Should this work?
>
> $f1 = rand(999,999);
>
> while($check_si
You are resetting $row inside your loop. Don't do that.
On Sun, 19 May 2002, Lee P Reilly wrote:
> Hi,
>
> I wonder if someone could have a quick look at this for me? It's a
> simple while loop, but it's not acting the way (I think) it should. If I
> break down the while loop, it reads:
>
> ---
> while($row = mysql_fetch_array($result))
> {
So, your while loop is based on values of $row.
> $row = mysql_fetch_array($result);
Now within your while loop you've altered the value of $row - poor thing
is probably a tad confused.
CYA, Dave
--
PHP General Mailing List (http:/
Line 13 is re-assigning $result, the save variable you're using in line 1!
1 while($row = mysql_fetch_array($result))
2 {
3$pri = $row['pri'];
4$fg = $row['fg'];
5$molw = $row['molw'];
6$density = $row['density'];
7$denstype = $row['denstype'];
8$pctd = $row['pct
LPR>
LPR> while($row = mysql_fetch_array($result))
LPR> {
LPR> $pri = $row['pri'];
LPR> $fg = $row['fg'];
LPR> $molw = $row['molw'];
LPR> $density = $row['density'];
LPR> $denstype = $row['denstype'];
LPR> $pctd = $row['pctd
Hi
add the newline and white space first like this
$data_printed = "";
while ($row = mysql_fetch_assoc($result)) {
if($data_printed != ""){
$data_printed .= " \n";
}
$data_printed = "" .
$row['file_name'] . "";
}
That will add to all except the last on
On Thursday 28 March 2002 05:20, Erik Price wrote:
> On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote:
> > When you have all your items in an array use implode to add a character
> > in between every item.
> >
> > $str = implode($yourArray, $separator);
> >
> > This will add the sep
On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote:
> When you have all your items in an array use implode to add a character
> in between every item.
>
> $str = implode($yourArray, $separator);
>
> This will add the separator to the end of each string except the last
> one.
I like
At 11:02 AM -0400 8/20/01, [EMAIL PROTECTED] wrote:
>
>
>$results = mysql_db_query("$db", "select * from $table where $query order
>by update_datetime desc limit $offset, 10");
>
>while($one = mysql_fetch_array($results)){
> $id=$one["id"];
> $title=$one["title"];
> $description
okay - read all the code now.
this might be a better way:
0)
{
for ($x=0;$x<$numrows;$x++)
{
$id=$one["id"];
$title=$one["title"];
$description=$one["description"];
print "
$title$description\n
\n
";
} // end of for
}
else
{
print "
NO
RESULTS\n
\n
";
}
?>
--
PHP Ge
try using mysql_num_rows() to get the number of rows returned by the query.
you need to supply it with the identifier for the query not the sql you sent
to the query. not exactly sure what you're trying to do though ...
Steve
<[EMAIL PROTECTED]> wrote in message
BB6D932A42D6D211B4AC0090274EBB1D2
Thanks Steve! :) Here's the code:
$title$description\n
\n
";
};
if($results <= 0)
{
print "
NO
RESULTS\n
\n
";
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EM
did you do it again ?
:-)
pasting you code is ok ...
Steve
<[EMAIL PROTECTED]> wrote in message
BB6D932A42D6D211B4AC0090274EBB1D2EF0EE@GLOBAL1">news:BB6D932A42D6D211B4AC0090274EBB1D2EF0EE@GLOBAL1...
>
> Here's the attachment - I hate it when I do that! :)
>
>
>
> -Original Message-
> Fr
Here's the attachment - I hate it when I do that! :)
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 8/20/01 10:25 AM
Subject: [PHP] while loop with if statement
I can't figure out why the if statement isn't working. The page
displays
the same with or without t
valuation.
>
> I thought '==' should be used in this context?
>
> Zeus
> - Original Message -
> From: David Robley <[EMAIL PROTECTED]>
> To: Zeus <[EMAIL PROTECTED]>; Michael Hall <[EMAIL PROTECTED]>; Jacky
> <[EMAIL PROTECTED]>
> C
lt;[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; Michael Hall <[EMAIL PROTECTED]>;
> Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 10, 2001 12:58 AM
> Subject: Re: [PHP] while loop
>
>
> > Isn't the '='
Zeus wrote:
>
> That was detailed :)
>
> Thanks Jack, it fixed my misconception of the = and == operators.
>
> BUT ...
>
> > mysql_fetch_array keeps track of where it is in the array.
> > after each while loop it moves a 'step ahead' in the result
>
> the mysql_fetch_array fetches the results
That was detailed :)
Thanks Jack, it fixed my misconception of the = and == operators.
BUT ...
> mysql_fetch_array keeps track of where it is in the array.
> after each while loop it moves a 'step ahead' in the result
the mysql_fetch_array fetches the results in an array but should it be an
on
Hi Jacky,
@ 2:11:06 PM on 4/10/2001, Jacky@lilst wrote:
> Not in the actual code, sorry, I did not copy the opnneing bit, but there is
> one in the code.
> So the same question, I got error said, maximum execution time exceed, am I
> doing something time consuming here?
Unless I'm blind this m
t for
yourself"
- Original Message -
From: Brian Clark <[EMAIL PROTECTED]>
To: PHP is not a drug. <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 1:05 AM
Subject: Re: [PHP] while loop
>
> Hi Jacky,
>
> @ 1:58:40 PM on 4/10/2001, Jacky@lilst w
Zeus wrote:
>
> Isn't the '=' operator suppose to be used for assigning and not for
> evaluation.
>
yup.
> I thought '==' should be used in this context?
nope.
Thing is, you ARE assigning. Here's a breakdown of the controlling part
of the loop in english:
--->while ($row = mysql_fetch_array
Hi Zeus,
@ 1:58:56 AM on 4/10/2001, Zeus wrote:
> Isn't the '=' operator suppose to be used for assigning and not for
> evaluation.
In this case, it /is/ used for assignment.
print $row['some_column'];
...
>> > Isn't this suppose to be an infinite loop?
>> >
>> > while ($row is assigned to m
Hi Jacky,
@ 1:58:40 PM on 4/10/2001, Jacky@lilst wrote:
> Here I got this script:
> $queryoffers = "SELECT * FROM MiniOffers WHERE hotel_id = '$hotelID'
> ORDER BY start_date ASC";
> $resultofrs = mysql_query($queryoffers, $connection) or die(mysql_error());
> while($row = mysql_fetch_arra
-
From: Zeus <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; Michael Hall <[EMAIL PROTECTED]>;
Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 12:58 AM
Subject: Re: [PHP] while loop
> Isn't the '=' operator suppose to b
ROTECTED]>; Jacky
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, 10 April, 2001 1:53 PM
Subject: Re: [PHP] while loop
> On Tue, 10 Apr 2001 15:16, Zeus wrote:
> > > $query = mysql_query("some SQL here");
> > > while ($row = mysql_fetch_arra
On Tue, 10 Apr 2001 15:16, Zeus wrote:
> > $query = mysql_query("some SQL here");
> > while ($row = mysql_fetch_array($query)) {
> > do stuff;
> > }
>
> Isn't this suppose to be an infinite loop?
>
> while ($row is assigned to mysql_fetch_array($query)) {
> do stuffs;
> }
>
> someone correct me if
> Isn't this suppose to be an infinite loop?
>
> while ($row is assigned to mysql_fetch_array($query)) {
> do stuffs;
> }
>
> someone correct me if I'm wrong?
They key here is that there's a single "=" in the condition.
... this is actually "while 'row equals the result of
mysql_fetch_array
> $query = mysql_query("some SQL here");
> while ($row = mysql_fetch_array($query)) {
> do stuff;
> }
Isn't this suppose to be an infinite loop?
while ($row is assigned to mysql_fetch_array($query)) {
do stuffs;
}
someone correct me if I'm wrong?
Zeus
--
PHP General Mailing List (http://ww
$query = mysql_query("some SQL here");
while ($row = mysql_fetch_array($query)) {
do stuff;
}
Mick
On Tue, 10 Apr 2001, Jacky wrote:
> Hi people
> I am more like ASP programmer and new to PHP, In ASP, when we want to take all
>records in dayabase to display. After we did do the query
On Tue, 10 Apr 2001 22:52, Jacky wrote:
> Hi people
> I am more like ASP programmer and new to PHP, In ASP, when we want to
> take all records in dayabase to display. After we did do the query, we
> call " Do while not RS.EOF ( mean do while not end of record file) ,
> and display record accrodin
On 4/10/01 6:22 AM, "Jacky" <[EMAIL PROTECTED]> wrote:
> Hi people
> I am more like ASP programmer and new to PHP, In ASP, when we want to take all
> records in dayabase to display. After we did do the query, we call " Do while
> not RS.EOF ( mean do while not end of record file) , and display
by default, HTML browsers, according to spec, will handle the rendering of
any and all empty cells at the end of a row.
even netscape ;)
so, this is technically not a bug.
my question is how it works when you have 7 photos in a row, or 4?
DanO
-Original Message-
From: James, Yz [m
"James, Yz" wrote:
OK, using this code:
echo "\n";
echo "\n";
$photocount = 0;
while($row = mysql_fetch_array($result)) {
$smallpic = $row['smallpic'];
echo "$smallpic\n";
if (($photocount % 3) == 2) {
echo "\n\n";
}
$photocount++;
}
This should fill in the remaining cells yo
43 matches
Mail list logo