473,660 Members | 2,475 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 1332
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
4976
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
26950
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 2003 server). Everything was fine for 2 weeks, then one morning they came in and the queries were...
59
4980
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 impressed with how quickly you can get database info onto a page.
131
6108
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
2422
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 is---------. WTF are these people thinking?
0
1824
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 old
8
2333
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. So I am using Microsoft compiler and I have a class with lots of methods with get and set :
56
2971
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 results. So could anybody help me giving some link or sending some stuff to me ?
0
2185
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). Traditionally I think of a classic structure as simply an object where every member is public. But with...
0
8341
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8539
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
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
2
1739
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.