473,513 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return A Value To The Top Of The Script

Ajm113
161 New Member
Ok, I have a page that writes the results that are shown and I would like to count them then return the number wich would be stored in a variable to the top of the page. So it can show how many results it retrived. Then showing at the bottom which would not help the user that much if their was a thousand results.

Example of a code that does not work.

[PHP]$NumOfResults = 0;

echo "There Are ".$NumOfResults." result(s)."; //Display number of rows.

while(mysqlResults)
{
$result = $row[result];

$NumOfResults++;

echo $result;
}[/PHP]
This is just a example just to give you a idea what I am trying to do.

I know I can use the mysql function to retrive the results, but It does not help for the results that are really displaying.
Dec 17 '07 #1
2 1438
vituko
48 New Member
instead of
[PHP] echo $result;[/PHP]
do [PHP]$string .= $result ;[/PHP]
and then
[PHP] echo "There Are ".$NumOfResults." result(s).";
echo $string ;[/PHP]

You can also control the output buffer (obstart / obgetclean / ...)
Dec 18 '07 #2
Ajm113
161 New Member
Thank you very much for your reply. This will indeed help me with my project a lot. :)
Dec 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
3075
by: Don | last post by:
I want the server-side php script to return a browser page that is essentially a copy of the original client page that contained the <form> which referenced the php script in the first place....
5
8157
by: Lee | last post by:
I am using a modal window and an iFrame to try and pull a return value back. I am doing this across domains. I have the value returned from the modal window to the iFrame window but I can not...
0
1990
by: Bill | last post by:
I have the following line in a php script $queryDeletePosition = mysql_query("DELETE FROM `Position` WHERE `stockID` = '$existStockID' AND `userID`='$userID' AND `groupID`='$groupID' LIMIT 1 ",...
1
3404
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to...
18
2240
by: Ed Jay | last post by:
<disclaimer>js newbie</disclaimer> My page has a form comprised of several radio buttons. I want to poll the buttons to determine which button was selected and convert its value to a string. I...
13
3984
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
3
5184
by: Odd Bjørn Andersen | last post by:
Is there a way to check the return status from a stored procedure when called from a OS (Windows) script? I have a stored procedure that does some checking in the database, and the return status...
2
3062
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the...
1
2344
vikas251074
by: vikas251074 | last post by:
When the page loads default date is displayed in both date field. Can I set null value in expected return date just after selecting 'NR' Not returnable in list? Is there any idea? ...
4
34272
by: devi thapa | last post by:
Hi, I am executing a python script in a shell script. The python script actually returns a value. So, can I get the return value in a shell script? If yes, then help me out. Regards, Devi
0
7175
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...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7542
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...
0
5697
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,...
1
5100
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...
0
3247
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...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
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...

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.