Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Display The Number Of Results


How can I set the classical search engine message? Found ### results. How can I count the returned results and display them in the results page? so now has the Found 5 results or any number that the result contains.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Display Number Of DB Results Beside A Link?
For an example, if you look at www.menupages.ie they give you a preview of how many results are found for each link.

ie:

 Ballsbridge Restaurants   (52)
 Blackrock Restaurants  (17)
 Clondalkin Restaurants  (18)
 Clontarf Restaurants  (17)

How is this achieved. I take it that it must be a select count on the DB for each row but that seems pointless, is there an easy way to achieve this?

Display Results
I have created a form where the number of rows are displayed based on a value from a select box. Everything works excellent this far. however I need to take it to the next step where I display the information back into the form based on values in a mysql table. Code:

Results Only X Number Per Page...
am doing a real state site and when searching it shows all the results from the database in one single webpage, can you help me with one easy way to show only 10 results per page?

I've seen some complicated sites with previous and next arrows, i only need to show 10 results then a link to show next 10 and that's it.

Display The Whole Number Without (E*) Power
how do you format the number so it will not have E-59

I want the full string what ever it may be

1.3775058103002 E-59

Categorical Results Display
I want to take these results and display them by category. I.e. each of these results would fall into different categories like "insurance", they are maked in the database simply with a "Y" for each category that they would appear in. I could make a page like this for each of the 20 categories, but I am sure there is a better way.
<?
if(!IsSet($start))
$start = 0;
$result = mysql_query("SELECT site_name, site_address, site_image, publish FROM sites WHERE publish = 'Y' ORDER BY site_name ASC LIMIT $start,144") or die(mysql_error());
?>
<table width="100%" border="0" cellspacing="4" cellpadding="4" align="center">
<tr>
<?
while($row = mysql_fetch_object($result))
{
echo '<td width="25%" align="center" valign="top"><a href= "',$row->site_address,'" target="_blank"><img src="samples/',$row->site_image,'"width="100" height="75" border="0"></a><br><a href= "',$row->site_address,'" target="_blank">',$row->site_name,'</a></td>'
if(++$i % 4 == 0)
echo '</tr><tr>'
}
?>
</table>

How Do I Display The Results Of A Test?
i just started learning php and have a quick question. this is my code:

$a=4;
$a==7;

what i want to know is how to display the results (either true or false). i tried print($a); but it only outputs the original variable value (in this case 4).

Display Results Vertically
I am creating a catalogue-like application and I want to display the items vertically instead of horizontally. Being somewhat new to PHP, the only thing I can think of are seperate queries for each field. Is there an easier way? Here's an example of how I want it to look.

Category 1
field1: result
field2: result
field3: result

Category 2
field4: result
field5: result

and so on and so forth....

Display Results According To Distance
I have a php/mysql driven website. On my search bar I have the option of searching by zip code. I have the function to find the radius of the surrounding zip codes. But I want to display the result along with my information from the other table.

An example would be:

I want to search for ads around my zip code for a range of 20 miles. The class I have will find all the zips and get their distances plus will sort them by closest to farthest. My problem is I want to display the records according to the distance provided. I heard of doing a sort with php but I am not sure which route to go.

I hope someone has found out how to do it, because this is the only thing left to do in order to launch the site.

Displaying X Number Of Results Per Page
What I need to do is this. I query a MySQL database and, for example, 400 results are returned. I can get it to display the number of results, but I would like to set a value to display, say 20, results per page and generate numbered links with and offset to browse through and next/previous buttons -not unlike this page. Can anyone point me in the direction of a good article or if you have it, post some code here?

I Get The Number Of Raws From A Query, But Can't See Results
I get the number of raws from a query, but can't see results?

Display Number Of Records Into Pages
we are using oracle database, Oracle Select statement is not supporting the LIMIT , Is there any other way to display records into pages.

Display Only A Specific Number Of Items
what would be the best way to display on a specific number of database variables in a list or td?

How Do I Display Radio Button Results?
I have a form which uses several radio buttons to enter data. It works fine
as far as entering goes, but I can't figure out how to display which button
is checked when I view the record. I could do a if-then routine but it
seems like there should be an easier way.

Display Query Results In A Table
$sql = "SELECT name FROM employee_tb;
$result_query = @mysql_query ($sql);// run the query
while ($row = mysql_fetch_array($result_query,MYSQL_NUM)){
$name = $row[0];}
// assuming i have 8 results

how can i display the results from this query in a table with 3 rows each column?

Search & Display PEAR DB Results
I'm only a novice in PHP & PEAR DB, and currently stuck in an attempt to create a "search & display query PEAR DB results" page. Here's my pseudocode:

1) Display page with a searchbox and a search button.

2) Upon hitting the search button, run sql query ... Select all fields from TableA and selected fields from TableB where field1 like "searchbox" order by field1

3) If searchbox is blank
-> prompt user to enter search value
Elseif search result NOT found
-> alert user >> Record NOT found
Else
-> display results in a table (with alternating colours for each row)

4) Able to paginate the results in something like display 10, 20, 30, etc records on the same page .... the amount of records to be displayed can be manually selected by the user (via a dropdown box) ... with Previous Page, Next Page links as well.

>> How would I do that entirely in code from scratch? I've found other tutorials on doing it but it is tailored for MySQL ... but I'm using PEAR DB... the syntax is different.

>> Since I am querying two tables based on the same search value, how am i able to concatenate both the tables search results and display it inline in the display results page?

Display Search Results In Pages
im doing a query on a table that searches articles from the database, and i was wondering how i could display the results as groups of ten, so the next ten search matches are displayed when the user presses a page number.

3 Comlumn Display Results With Pagination
I have the following code that works perfectly.  I would like to add an easy pagination feature that limits the number of items, counts the number of records and makes links and pages for the next page. Code:

Display Results Of Survey In A Table.
Is it possible to have them fill in a survey with about 10 form fields, then display
the results of everyone's survey in a table that can be sorted by different criteria
so new users to the site can instantly see which one of our services is better for them.

Display Only Mysql_num_rows Results #-# (or Similar)
I have this mysql database. It works great, the stuff outputs how I want. But I'm making a news website and I need to change the articles each month.

I'm putting all the articles into one database, then into each page as tables (ie: news, opinion, sports, etc.), then the articles each have their own row. On the homepage here it outputs all 5 articles from the news table, but I only want it to output result numbers (blah) through (whatever). Code:

Display Results From Multiple Tables
I have two tables, one table (article_cat) has four fields ("id", "title", "feature1", and "feature2") and the other table has six fields (articles) has ("id", "cat_id", "title", "content", "feature1", and "feature2").

I am looking to display the "title" from the "article_cat" table that has "feature1" with a value of 1. And I want to display beneath that all the "title" results from the "articles" table where "feature1" has a value of 1. I have tried this a thousand ways with no luck. Code:

Displaying X Number Of MySQL Results Per Page
I'm writing a search on a MySQL DB, and everything so far has just gone swimmingly. I've got a "results per page" drop down box in my form, with a few different values.

At the moment, I'm just using:

while($myrow = mysql_fetch_array($result)

to output results to screen.

I'm not too sure how to go about it, but I did have two thoughts:

1) Suck the results into a multi-dimensional array, and pass the array to a display results script (not sure if you can pass arrays to other scripts???

2) Display x number of results, then have the "Next" (or 2, 3... ) links call the search again, but displaying results x+1 - x+x.

1 sounds like too much trouble, and 2 sounds inefficient. Not too sure how else to go about it. Any info / thoughts you guys have would be much appreciated.

On a side note, how do you look at a specific row in the result?

Flat File Display <i>x</i> Number Of Lines
I have a "site updates" script that I wrote that stores my site updates in a flat file in the form:

21234123|>|blah blah blah
21234123|>|blah blah blah
21234123|>|blah blah blah

where 21234123 is a unix timestamp.

what I want, is to be able to display the last x updates on my main page. I have a "updates.php" page which displays ALL updates... but I want to display just the say... most recent 3 or 5 updates at the bottom of my main page.

This is my function that displays -all- updates.

Want To Display Number Of Views Of Blog Posts
I've seen a Drupal blog which lists the number of times a post has been viewed. I discovered that WordPress (my platform) has 2 such plugins, but they only feature the top 5 or top 10 posts. What I'd like is a list of the top 25, 50 or 100 posts. I don't care whether the data displays within the blog or whether only I can view it.

One of the moderators at the WP forum posted this obscure reply which only contains this code:

$results = $wpdb->get_results("select postnumber, cntaccess from mostAccessed ORDER BY cntaccess DESC LIMIT 1000");

Since he's not replying to any questions of mine, can anyone help me figure out what this code does, where it should be installed & how it would display the data within the blog interface? I also assume the "LIMIT 1000" should read "LIMIT 100?"

Limiting Results, And Display Page Numbers
How do I make it so only 50 items display per page. And if there's more than 50, it displays a link "page 2", "page 3" and so on? I know how to limit results with MySQL but how do I generate pages for the next 50 within the PHP code?

Select And Display Multiple Queries / Results
Howdy all, i've been looking through various sites / tutorials and through this php book I have here to try figure out whats causing this problem but haven't had any luck yet.

The problem is that its displaying the Designation as the link url instead of the jcode. Hope i explained this well. Above this bit of code has calls the individual Catagorys, if theres data in that catagory it will display it with whats below. PHP Code:

Display Results From Query In HTML-table
I'm working with PHP3 and Oracle 8. Can anyone tell me how to display the results from a query into my HTML-table?

Checkboxes In A Form To Determine Whether To Display In Results
I am making an effort to put checkboxes in my form that will determine whether to display that column or not. This is my first time doing this with PHP and I am hoping you gurus can assist. I have gotten some extremely great assistance in the past, so I am looking forward to any recommendations.

currently my form is as follows:

Display Results From A Database On Multiple Pages
I am new to PHP and Mysql but am really determined to learn these techniques. I have some script that reads and displays results from the databse onto a page. However, I really wish to limit the number of results that are displayed to 10 per page and then have the next/privious links under the results. With these results, the results under the email field should be hyperlinked so that the person viewing the results should double click on the email link and send the person an email. How can i do that? I have to learn this technique.

The code is:-

Getting Results To Display In Two Columns Of A HTML Table
How can i get the following script to display in two columns of a HTML table? At the moment i have it displaying in one column. If there are 5 results from the DB then the left HTML table column will display the 1st, 3rd and 5th result. The right HTML table column will display the 2nd and 4th results. Code:

Sending Variable To Display Number Of Records To Write?
Sorry, couldn't come up with any reasonably short subject.

I am sort of new to PHP. I've got an event registration database (MySQL). In it, I have two tables, one for the registrant's info, and one for the reservations. Assuming that one registrant can make more than one reservation.

There are 4 types of registrations. What I would like to do is to have the first page filled out with the registrant info, and have the registrant select the number of each type of reservations he/she would like. These numbers will not be written to the database, but will be used to determine how many of each type of reservation will be shown in the next window. Once the info is submitted (and written to the database), the user will then be taken to another page where they will enter the name for each registration, as well as the entree choice.

so, the question is, how to do that (I will be passing the RegID as the primary key from tblRegistrant to use as the linked field to tblReservations). Ideally, I'd also like some sort of edit button so people don't try to use the back browser button to change their numbers. Any suggestions?

Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?

Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?

Extract And Display A Number From A HTML File - Regular Expression
I'm just wondering what the best way is to extract and display a
number from a html file.

I tried the following piece of code, however it does not work.

ereg('d.d', $content, $reg);
echo $reg[0];

Query Array, Sort Results And Display In Seperate Tables
The problem I have it breaking out the results and displaying them (broken out) alphabetically in seperate tables. For instance, I have generated (bookmarked) tables, one for each letter (A-Z) and want to display all recordsets with say, last name
beginning with "A" in one 2 column table, "B" in another 2 column table, and so on... each
table would have two columns (with 2 background colors alternating), each cell containing values of one recordset.

Even more tricky is if I have an odd number of cells, still generating the last cell with empty values (for asthetics). And can anyone say "sort" (yes, I am nuts)? The ability to sort the whole mess by any column value. I have looked at freeware and other third part apps, but they can only do what I already can do (mine is actually cleaner) but not as complicated.

Replace Hex Number Or Decimal Number In A String ?
String may contain alphanumeric values. What is the bestway to replace a hex number such as 0x122aaa and decimal number such as 5678 with a string "blah" Example: I want to replace below--

wr_thru1 data or mask mismatch!! for addr=0x00000b73a0540 & mdfid:11
with
wr_thru1 data or mask mismatch!! for addr=hexVal & mdfid:decVal

Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?

Order Number Or Tracking Number
I need to create some kind of random number within a persons session that can be inserted into a customer id column for their orders, customer, and credit card tables.

Unless their is a better way to link a customers information together between a few tables besides using auto increment. Things could get screwed up for me if I use auto increment, especially if someone submits their information but does not actually place an order.

My question is " How can I create a random order number that can be used within a persons session and will stay the same throughout the whole program for that one person? "

Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10.

I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???

Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results.

I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:

Number For Each Value
What I am doing is getting values from a database and what I need to do is print out each of them and print a number for each one, like this.

Odd Even Number
if I have a for loop :
for ($i=0; $i<count($replyDetails); $i++){
...
bgcolor = 123 (OR 456)...
...
}
and will show bgcolor = 123 if $i is an even number or $i=0
and will show bgcolor = 456 if $i is an odd number

Number St Nd Rd Th
How can I have a number variable and see whether it needs a st, nd, rd, or th at the end?like 1st, 2nd, 3rd, 4th... I originally thought I could select the last number but for example if it equaled 11, 12 or 13 the idea wouldn't work as they take th.

How To Add A <br> After 3 Results?
I am wondering if anyone could help me solve this issue. I am using a foreach loop and i would like to add a line break after three records then repeat the process.

Example:

foreach($array as $v){
echo $v.' ';}

In that example, it will display ( apples oranges banana pumpkin turnips pineapple beer pepsi) How do i get it to display:

apples oranges banana
pumpkin turnips pineapple
beer pepsi etc....

Notice above that after each three results the next three are placed on a new line. How can I accomplish that with my loop.

Getting Results Twice?
I am having a small problem. I have a small script which gets a METAR feed, processes it and then displays the weather information. The problem is that it will accept 1 weather station as an input variable.

How can I run this script TWICE within the same execution, while getting 2 results, using 2 different weather stations? The main file uses this to execute the functions which are on another separate file: Code:

Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56.

I have been using:
mysql_num_rows

What should I be using?

Help With Getting A Number Of Posts
Hi, I've been trying to make a message board of sorts, and I'm having trouble getting the number of posts in each forum to show correctly. The two tables in mysql im trying to use in order to do this are a table called info, and a table called forumlist. Forumlist has two columns, one with forum_id, and one with forumname. Right now it has three entries, Test Thread, Game Thread, and Discussion Thread, with forum_ids of 1, 2, and 3 respecitively. In the table info, there is a bunch of columns pertaining to the author, the description, but those don't really matter, the one column that does in info is the column forum_id which is an integer I am using to keep track of which thread is in which forum.

Right now there is only one entry in the info table, and that has a forum_id of 1. I have been trying to get it to show that there is one total post in the Test Thread, and 0 in the two others, but for some reason it keeps saying there is one in the Game Thread, and 0 in the others. I tried changing the forum_id to 2 in the info table, but then it said that I had one post in the Discussion Thread and 0 in the others. It seems to be jumping ahead by one for some reason. I could use some help, here is my code:

Number Into Month With St,nd,rd,th
Is there a shorter faster way to do this...? PHP Code:

Most Recent By ID Number
Is there anyway to get the 5 most recent links added by using the field ID that I have in my database?

Format Number To 01 And Not 1
How do i format numbers to two digit all the time : eg. 01 instead of just 1 .... 02 instead of 2 ..... but 11 is just 11.


Copyright © 2005-08 www.BigResource.com, All rights reserved