On Mon, Sep 19, 2011 at 18:22, George Langley wrote:
> Hi all. Had a meeting today where I was rather condescendingly told
> that most CMS web sites use SharePoint.
Well, you may reply, equally condescendingly, that you will need
that to have cited references, as it's simply incorrect
-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:
bruce wrote:
> interesting points regarding college and programming..
>
> my degrees bsee/msee covered alot more than pure programing.. as a double
> ee/cs, the ability to articulate an issue/problem, and bring to mind a cogent
> thought process was valuable. the ability to understand how differ
: php-general@lists.php.net
Subject: RE: [PHP] while-question
> Dabbling?
>
> I think that making a living from it isn't dabbling, so I may not be
> qualified to speak for the dabblers.
>
> But for me, I was writing code before there were such courses. Later,
> when
On Tue, 2008-11-18 at 10:52 +, Nathan Rixham wrote:
> Ashley Sheridan wrote:
> > On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
> >> Ashley Sheridan wrote:
> >>> On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
> >>>
> Only thing to note with the foreach is that you are
On Tue, 2008-11-18 at 14:33 +, Nathan Rixham wrote:
> Craige Leeder wrote:
> > Jochem Maas wrote:
> >> klieder ... kliederen
> >>
> >> the E sound is short.
> >>
> >>
> > Interesting to know. Thanks :D
> >
> > - Craige
>
> don't believe him, "jochem" is really called Bob Davis, a slightly
On Tue, Nov 18, 2008 at 9:33 AM, Nathan Rixham <[EMAIL PROTECTED]> wrote:
> Craige Leeder wrote:
>
>> Jochem Maas wrote:
>>
>>> klieder ... kliederen
>>>
>>> the E sound is short.
>>>
>>>
>>>
>> Interesting to know. Thanks :D
>>
>> - Craige
>>
>
> don't believe him, "jochem" is really called Bob D
Craige Leeder wrote:
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
don't believe him, "jochem" is really called Bob Davis, a slightly
balding middle aged ASP developer from hull sent to infiltrate the PHP
community and misguide
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Craige Leeder schreef:
> Jochem Maas wrote:
>> just for laughs .. given the 'dabble' thread "Cleeder" is phonetically
>> very very close to a dutch word meaning 'messing around' .. rather in
>> the way
>> a 2yo might mess around with a bowl of yogurt.
>>
> Haha, now that does make me laugh. Out
Jochem Maas wrote:
just for laughs .. given the 'dabble' thread "Cleeder" is phonetically
very very close to a dutch word meaning 'messing around' .. rather in the way
a 2yo might mess around with a bowl of yogurt.
Haha, now that does make me laugh. Out of curiosity, what is the actual
word f
tedd wrote:
At 7:02 PM -0500 11/17/08, Craige Leeder wrote:
I'm not illiterate; promise :p
- Craige
Yeah, his parents were married before he was born.
Cheers,
tedd
omg tedd, I was just reading this thread over, thought exactly that
witty response, clicked you're reply and there it is;
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it b
Craige Leeder schreef:
> Jochem Maas wrote:
>> must . resist
>>
>> "I take you didn't score to hig on the spelling test? and collage,
>> is that the the cut-n-paste school of IT?"
>>
>> dang it, failed. ;-)
>>
>
>
> Haha! 'high' was just my 'h' key not pressing, and college is j
tedd schreef:
> At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
>> Craige Leeder schreef:
>> > I'm 100% self taught for now. I'm just out of higschool, and hopefully
>>> going off to collage next year.
>>
>> must . resist
>>
>> "I take you didn't score to hig on the spelling test? and co
Jay Blanchard wrote:
> [snip]
> ...foreach...
> [/snip]
>
> You could also use a for loop if you wanted to count;
>
> for($i = 0; $i < count($array); $i++){
>echo $i . "\n";
> }
>
>
>
This is not good because you are calling count every loop iteration.
Thank you,
Micah Gersten
onShore Netw
At 7:02 PM -0500 11/17/08, Craige Leeder wrote:
I'm not illiterate; promise :p
- Craige
Yeah, his parents were married before he was born.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To u
At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
Craige Leeder schreef:
> I'm 100% self taught for now. I'm just out of higschool, and hopefully
going off to collage next year.
must . resist
"I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-pas
Craige Leeder schreef:
> Ashley Sheridan wrote:
>> On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
>>
>>> Only thing to note with the foreach is that you are actually working
>>> on a copy of the array, so if you intend to modify it, pass it by
>>> reference.
>>>
>>> - Craige
>>>
>>
Jochem Maas wrote:
must . resist
"I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?"
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those words I have trouble with.
tedd schreef:
> At 10:00 AM -0800 11/17/08, bruce wrote:
>> curious qiestion
>>
>> to all on here who dabble in php... how many of you have actully gone to
>> college, taken algorithm courses, microprocessor courses,
>> design/architecture courses, etc..
>>
>> or is the majority of the work her
Craige Leeder schreef:
> bruce wrote:
>> curious qiestion
>>
>> to all on here who dabble in php... how many of you have actully gone to
>> college, taken algorithm courses, microprocessor courses,
>> design/architecture courses, etc..
>>
>> or is the majority of the work here from people who'v
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started programmin
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
> Ashley Sheridan wrote:
> > On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
> >
> >> Only thing to note with the foreach is that you are actually working on
> >> a copy of the array, so if you intend to modify it, pass it by refer
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
- Craige
Can you do that? I assume it would look like this:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
> Alain Roger wrote:
> > Hi,
> >
> > i'm on PHP training and our lector is telling us that to avoid counting an
> > array item amout thanks count($my_array), he tells we can do:
> > while($my_array)
> > {
> > ... do something
> > }
> > but fr
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = coun
At 2:55 PM -0500 11/17/08, Wolf wrote:
Tedd, glad you got hooked on Phonics. One of these days I hope from
graduating from just looking at the pictures, but right now the
pictures are oh so enticing!. ;)
Wolf
Wolf:
Lot's of exciting things -- hard to keep up on bots, automated
buying, da
> Dabbling?
>
> I think that making a living from it isn't dabbling, so I may not be
> qualified to speak for the dabblers.
>
> But for me, I was writing code before there were such courses. Later,
> when I went to college I was taught adventures in keypunching and
> received several "next to
At 10:00 AM -0800 11/17/08, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started programmin
On Mon, 2008-11-17 at 19:07 +0100, Jochem Maas wrote:
> Robert Cummings schreef:
> > On Mon, 2008-11-17 at 14:54 +, Stut wrote:
> >> On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
> >>> if you really want a challenge try this one..
> >>>
> >>> task: add the numbers 5 and 17 together, using php,
On Mon, 2008-11-17 at 10:00 -0800, bruce wrote:
> curious qiestion
>
> to all on here who dabble in php... how many of you have actully gone to
> college, taken algorithm courses, microprocessor courses,
> design/architecture courses, etc..
>
> or is the majority of the work here from people
Robert Cummings schreef:
> On Mon, 2008-11-17 at 14:54 +, Stut wrote:
>> On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
>>> if you really want a challenge try this one..
>>>
>>> task: add the numbers 5 and 17 together, using php, without using
>>> the + operator. fill it in:
>>>
>>> function
mming... ?
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 9:53 AM
To: Stut
Cc: Nathan Rixham; php-general@lists.php.net
Subject: Re: [PHP] while-question
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
> On 17 Nov 2008, at 14:31, Nathan Rixh
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
> On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
> > if you really want a challenge try this one..
> >
> > task: add the numbers 5 and 17 together, using php, without using
> > the + operator. fill it in:
> >
> > function add($a , $b) {
> > //code he
Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using the
+ operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5, 1
On Mon, Nov 17, 2008 at 9:47 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Nathan Rixham schreef:
>> Jochem Maas wrote:
>>> $a = range(1,10);
>>> for ($i = 0, $c = count($a); $i < $c; print($a[$i]."\n"), $i++);
>>
>> think the point of this is to count the items in an array without count
>> mate :p
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5, 17);
Elemen
Nathan Rixham schreef:
> Jochem Maas wrote:
>> $a = range(1,10);
>> for ($i = 0, $c = count($a); $i < $c; print($a[$i]."\n"), $i++);
>
> think the point of this is to count the items in an array without count
> mate :p no point in the above you could just:
> $c = count($a);
I thought the point wa
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i < $c; print($a[$i]."\n"), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the above you could just:
$c = count($a);
foreach!
$a = range(1,10);
$c = 0;
foreach($a as $b) {
Timo Erbach schreef:
> ...but for best performance you should do:
>
>
> $counter = count($array);
> for($i = 0; $i < $counter; $i++){
> echo $i . "\n";
> }
just for fun:
$a = range(1,10);
for ($i = 0, $c = count($a); $i < $c; print($a[$i]."\n"), $i++);
... gives an idea of the power and flex
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted to count;
for($i = 0; $i < count($array); $i++){
echo $i . "\n";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = count($my_array);
whil
On 17 Nov 2008, at 13:01, Alain Roger wrote:
i'm on PHP training and our lector is telling us that to avoid
counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always someth
On Sat, February 23, 2008 10:16 am, Emiliano Boragina wrote:
>
> $buscar = $_REQUEST['buscar'];
>
> $base = "inscripcion";
>
> $conexion = mysql_connect ( 'localhost' , 'root' , 'root' );
>
> mysql_select_db ( $base , $conexion );
>
> echo "";
>
>
On Sat, Feb 23, 2008 at 11:16 AM, Emiliano Boragina
<[EMAIL PROTECTED]> wrote:
> Hi everyone
>
> I am beginner
>
> I have the following code:
>
>
>
>
> $buscar = $_REQUEST['buscar'];
>
> $base = "inscripcion";
>
> $conexion = mysql_connect ( 'localhost' , 'root' , 'ro
On 31/10/2007, Steven Macintyre <[EMAIL PROTECTED]> wrote:
> Hiya,
>
> I have the following code ... which only seems to result in one item ...
> which is incorrect ... can anyone spot my problem?
>
> if ($armbase != "") {
> $options = explode(",", $armbase);
>
On Wed, 2007-10-31 at 16:20 +0200, Steven Macintyre wrote:
> > Your subject line says "while-do" + array, following code contains
> > a
> > "do-while" loop.
>
> Apologies :)
>
> > We can't debug the script very well without a
> > sample
> > input since we don't know how many times the loop "shou
> Your subject line says "while-do" + array, following code contains
> a
> "do-while" loop.
Apologies :)
> We can't debug the script very well without a
> sample
> input since we don't know how many times the loop "should" run. To
> debug
> yourself, try using print_r() to see exactly what the f
On Wed, 2007-10-31 at 13:02 +0200, Steven Macintyre wrote:
> Hiya,
>
> I have the following code ... which only seems to result in one item ...
> which is incorrect ... can anyone spot my problem?
Your subject line says "while-do" + array, following code contains a
"do-while" loop. We can't debug
>
> I guess it is the missing semicolon.
>
>
> And you can write:
>
> echo ""
>
> as simply
>
> echo "$product_type"
>
I prefer
echo '', $product_type, '';
No string concatenation, or variable replacement required.
Jared
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Mary-Anne Nayler wrote:
Hi Mark,
As far as I can see the only problem is that you have forgotten to add a
semicolon after the i++
Mark:
Since you are not displaying the counter, you really don't need to
mess with $i.
You can reduce your code to just :
$db = mysql_connect("localhost", "r
On Mon, May 9, 2005 10:57 pm, Mark Sargent said:
> Thanx. I saw the extra echo and removed it. Problem with that code,
> though. It displays only the 1st record, repeatedly, causing the browser
> to hang. Can anyone see what is wrong..? Cheers.
Everybody else has told you to move the $i++; inside
Mary-Anne Nayler wrote:
oh, and the i++ should be inside the while loop and there is also a
missing semi colon after the echo, ie;
$i=0;
while ($i < $num){
$product_type=mysql_result($result,$i,"product_type_detail");
echo "";
$i++ ;
}
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
Hi Mark,
As far as I can see the only problem is that you have forgotten to add a
semicolon after the i++
Cheers,
Mary-Anne
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
http://www.freewebmasterhelp.com/tutorials/phpmysql/5
has the below code,
$first=mysql_result($result,$i,"fir
quoth the Mark Sargent:
>
>
> Jumbo Status
> $db = mysql_connect("localhost", "root", "grunger");
> mysql_select_db("status",$db);
> $result = mysql_query("SELECT ProductTypes.product_type_detail FROM
> ProductTypes",$db);
> $myrow = mysql_fetch_array($result);
> $num = mysql_num_rows($result);
oh, and the i++ should be inside the while loop and there is also a
missing semi colon after the echo, ie;
$i=0;
while ($i < $num){
$product_type=mysql_result($result,$i,"product_type_detail");
echo "";
$i++ ;
}
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
http://www.freewebmaster
Prathaban Mookiah wrote:
I guess it is the missing semicolon.
And you can write:
echo ""
as simply
echo "$product_type"
Prathap
-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 10 May 2005 13:23:51 +0900
Subject: [PHP] While and
Mark Sargent <[EMAIL PROTECTED]> writes:
> $i=0;
> while ($i < $num){
> $product_type=mysql_result($result,$i,"product_type_detail");
> echo ""
> }
> $i++
You should put "$i++" into the while loop. And you should add an ";"
at the end of the echo line as well as at the end of "$i++".
With kind r
I guess it is the missing semicolon.
And you can write:
echo ""
as simply
echo "$product_type"
Prathap
-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 10 May 2005 13:23:51 +0900
Subject: [PHP] While and echoing HTML
>
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
sorry, i overlooked on something.
i need to rest for a while, im working on a wrong program thats why it
wont work.
heh, :(. thanks again.
--
Louie Miranda
http://www.axishift.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Louie Miranda wrote:
i have a while statement inside a function, but it seems like it dont
work. is this possible?
Add the following lines:
global $apo;
global $row;
This will make it work for you but it's not the best solution. It's
better to pass in parameters to the function rather than to r
T. H. Grejc wrote:
Hallo,
I know of a few ways of doing this but I am not sure that any is right.
I want to consult with you what is the best way of doing this:
Table 1:
++-+
| *a* | *b* |
++-+
| 2 | 1|
++-+
| 2 | 2|
++-+
Table 2:
++-+
| *b*
* Thus wrote T. H. Grejc ([EMAIL PROTECTED]):
> Hallo,
>
> I know of a few ways of doing this but I am not sure that any is right.
> I want to consult with you what is the best way of doing this:
>
> ...
>
> I would like to select all 'b' from Table_1 WHERE a = '2' and then to
> select all 'd'
>
> I would like to select all 'b' from Table_1 WHERE a
> = '2' and then to
> select all 'd' from table_2 with 'b' from previous
> result.
>
> Table 2 is the Table with UserNames (d) and Table 1
> is the table with
> 'marked' UserID's (b).
>
If I understand you correctly, its sounds like you
Please don't cross-post.
See below - M.
At 10:17 AM 9/17/2003 -0400, Roger Spears wrote:
Hello,
Can anyone from the lists please tell me why this bit of code is not
picking up on the first record in the database? If the 'id' I'm looking
for is '1' it doesn't populate the _SESSION variables. An
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
On Saturday 25 January 2003 05:43, Rick Emery wrote:
> Define "fails"
> - Original Message -
> From: "Jay Fitzgerald" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 24, 2003 3:11 PM
> Subject: [PHP] WHILE IF/ELSE loop not working
>
>
> can anyone tell me why this whil
Define "fails"
- Original Message -
From: "Jay Fitzgerald" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 3:11 PM
Subject: [PHP] WHILE IF/ELSE loop not working
can anyone tell me why this while loop fails?
==
wh
Why not use while to loop through the shopping cart and add items to the
message variable?
$message = "
Here is your order:
";
while ($Row = mysql_fetch_array($Results))
$message .= "item description information";
$message .= "
Thanks for your order...
";
-Original Message-
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
On Friday 12 April 2002 06:15, Caspar Kennerdale wrote:
> This may be a baisc programming query, to which I dont have the ansa,
>
> but can you do a while () loop, but set a condition so that it misses one
> ie
>
> $counter = -1;
> while(++$counter <50){
>
> do a task on all between 1 and 50 excep
Thanks to all
-Original Message-
From: Christoph Starkmann [mailto:[EMAIL PROTECTED]]
Sent: 11 April 2002 07:22
To: 'Caspar Kennerdale'; '[EMAIL PROTECTED]'
Subject: RE: [PHP] while() query
Hi Caspar!
$counter = -1;
while(++$counter <50)
{
Hi Caspar!
$counter = -1;
while(++$counter <50)
{
if ($counter != 39)
{
do a task on all between 1 and 50 except on 39
}
}
This should do...
Cheers,
Kiko
--
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-
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
> ie - i have:
> while($myrow=mysql_fetch_array($result)) { etc...
>
> But i want the loop to run with an array i created earlier ($anotherarray =
> [key1] => value1, [key2] => value2).
>
use foreach($anotherarray as $key => $value) { .
A Nawroth
--
PHP General Mailing List (http://www.
You should probably take a look at each() for that... The functionality is not
the same but it's the only answer I can think of for your question (i.e.
mysql_fetch_row() _returns_ a key-value array while each() _walks_ a key-value
array).
Bogdan
Daniel Alsén wrote:
> Hi,
>
> i am fiddling with
I don't think so, but if I have to suspect my code or a bug in php, I'll
suspect my code. :)
I did a quick "if (isset($companyID_string)) { print "true"; } else { print
"false";} and that didn't turn up anything, but I didn't spend a whole lot of
effort on it.
Like I said, I'm pretty sure I s
ieber" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 1:17 PM
Subject: Re: [PHP] while() looping over query results twice?
> OK, so I defined the variables before using them and that solved the
problem.
OK, so I defined the variables before using them and that solved the problem.
(Thanks!)
I'm still curious as to why not defining them ahead of time would cause the
data within each string to get duplicated. In other words, if the query
results are "a,b,c,d", then by not defining the variable
I notice that you are concatinating then each time. try setting them to =""
before using them
$companyID_string = "";
$companyName_string = "";
then:
while()
{
$companyID_string .= "," . $query_data[0];
$companyName_string .= "," . $query_data[1];
}
Jim
Trying using mysql_fetch_array, and using the field names. This is the
recommended behaviour in PHP4:
$result = mysql_query($myQuery) //$myQuery gets defined earlier
$resultCount = mysql_num_rows($result);
$companyID = array();
while($query_data = mysql_fetch_
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
1 - 100 of 125 matches
Mail list logo