473,580 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

im REALLY sorry...

feel free to slap me in the face on this one... but... i cant figure
out why this wont work. its acting like its an infinate loop, no
errors, just wont load. ugh

<?php
while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}

?>

im a tool.

Aug 4 '05 #1
9 1328
meaby becaus it's realy empty =]

If you still want infinate loop so mutch consider using isset instead
of empty

Aug 4 '05 #2
I noticed that Message-ID:
<11************ *********@g44g2 000cwa.googlegr oups.com> from kiqyou_vf
contained the following:
while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}


You are checking whether $row_QCBD_test['test'] is empty or not.
Whatever it is, it will still be the same next time round the loop. You
need something in there to change the state of $row_QCBD_test['test']
other wise the loop will have no reason to end.

e.g
$x=0;
while($x<10){
print $x;
$x++;
}
//prints 0123456789
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Aug 4 '05 #3
On Thu, 04 Aug 2005 01:14:04 -0700, kiqyou_vf wrote:
<?php
while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}

?>
So, if $row_QCBD_test['test'] is not empty, what should
prevent the loop from executing ad infinitum? I don't see anything
to stop it. If nothing stops the loop, the loop will execute
indefinitely.

im a tool.


I’d rather be a sparrow than a snail
Yes I would, if I could, I surely would
I’d rather be a hammer than a nail
Yes I would, if I only could, I surely would

--
http://www.mgogala.com

Aug 4 '05 #4
Ohhhhh, I gotcha I gotcha. Ok, so $row_QCBD_test['test'] is an array
correct? Can I print out each row in $row_QCBD_test['test'] using a
while loop? I cant figure out what I'm missing. How about I do
something like

while ($rows_returned > 0)
print $row_QCBD_test['test']

Would that work?

I'm going to go play with this thing for the 3rd straight day, thanks
for your help.

Aug 5 '05 #5
I noticed that Message-ID:
<11************ *********@g49g2 000cwa.googlegr oups.com> from kiqyou_vf
contained the following:
Ohhhhh, I gotcha I gotcha. Ok, so $row_QCBD_test['test'] is an array
correct? Can I print out each row in $row_QCBD_test['test'] using a
while loop? I cant figure out what I'm missing. How about I do
something like

while ($rows_returned > 0)
print $row_QCBD_test['test']

Would that work?


No. 'While' requires something to change each time round. The bit in
brackets is a test for truth. In this case it would always be true and
hence the loop would be infinite.

I'm assuming you are querying a database? Normally there will be a
function which returns a new row (and hence true) each time it is
called. If it were MySQL you'd do something like:

$sql="SELECT * FROM table";
$result=mysql_q uery($sql);
while($myrow=my sql_fetch_array ($result)){
print $myrow['field1'].",".$myrow['field2']; //etc, etc
}

When there are no more rows, mysql_fetch_arr ay($result) returns false
and the loop stops.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Aug 5 '05 #6
<?
$row_QCBD_test['test']="Still Not Empty...\n";

while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}
?>

Output:
-----------------
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
Still Not Empty...
ad infinitum......

Aug 6 '05 #7
On Fri, 05 Aug 2005 11:31:07 -0700, kiqyou_vf wrote:
while ($rows_returned > 0)
print $row_QCBD_test['test']


Again, where is the terminating condition? How do you expect
$rows_returned to eventually drop down to 0 and terminate the loop?
The loop will continue executing for as long as $rows_returned> 0.
You haven't done much programming, have you? May be a course
in programming would be in order? Someone should teach you how
to write a program. Generally speaking, that's not always simple.

--
http://www.mgogala.com

Aug 6 '05 #8

"cameron7" <ca******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
<?
$row_QCBD_test['test']="Still Not Empty...\n";

while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}
?>

Output:
-----------------
Still Not Empty...


Try:

<?
$row_QCBD_test['test']="Still Not Empty...\n";

while (!$row_QCBD_tes t['test'])){
print $row_QCBD_test['test'];
$row_QCBD_test = mysql_fetch_ass oc(the_result_v ariable_of_your _query);
}

Shelly
Aug 6 '05 #9
Correction:

"Shelly" <sh************ @asap-consult.com> wrote in message
news:q6******** ********@twiste r.nyroc.rr.com. ..

"cameron7" <ca******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
<?
$row_QCBD_test['test']="Still Not Empty...\n";

while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
}
?>

Output:
-----------------
Still Not Empty...


Try:

<?
$row_QCBD_test['test']="Still Not Empty...\n";

while (!empty($row_QC BD_test['test'])){
print $row_QCBD_test['test'];
$row_QCBD_test = mysql_fetch_ass oc(the_result_v ariable_of_your _query);
}

Shelly

Aug 6 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
4946
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
7
26941
by: ddsvi78 | last post by:
I am a complete idiot when it comes to access. Now that said, I work for a computer security company and one of our customers came to us with an access problem. They had been running fine for a long time. Then about a month ago there main server that hosted all the .mdb files crashed. So they restored everything to a new server (I believe...
59
4962
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at ASP.NET. At first glance, it looks excellent, albeit nothing that couldn't have been done to Classic ASP. I have been through a few tutorials and was...
131
6067
by: pemo | last post by:
Is C really portable? And, apologies, but this is possibly a little OT? In c.l.c we often see 'not portable' comments, but I wonder just how portable C apps really are. I don't write portable C code - *not only* because, in a 'C sense', I
15
2413
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums that are formatted for number and then half way down they are changed to text. OR the famous ok now everything in red is ---- and everything in blue...
0
1819
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this code SHOULD do: - read new (=updated) licensetext from file $license_path then - read and modify recursively all files from $current_dir, replacing...
8
2330
by: Vincent RICHOMME | last post by:
Hi, first I would like to apologize about my question because usually I hate specific implementation but in this case I really would like an answer. Besides my example is an example of what's not to be done but I am aware of that. Don't loose time tell me that I should use standard implementation and consider my question as theoretical....
56
2951
by: tasteless | last post by:
Hi guys, I need really hard questions (about 10) about PHP programming (some of elements OOP as well, but no MySQL questions - this is different part), this questions needs to be very hard, but the experienced senior PHP developer should answered on it. I've already searched in google and google groups archive but without any good...
0
2182
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into problems later). Apparently Point is a struct, a value type, and it does not behave like a classic structure (in my mind's eye, and see below)....
0
7783
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8157
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6533
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3790
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1394
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.