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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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.

Link Display On Same Page?
I want to list the titles of all my articles from my database onto my webpage at articles.php. Then when the users click on each title, the individual articles will load on the same page.

I'm new to PHP/MySQL, so here is what i've done so far. row[0] as my unique id numbers for each article, and i've included it so that i can somehow tell the page to load the article related to the unique id number. Is this all making sense? Code:

Creating A Link Within Table Results?
I am using php and mysql. Does anyone have any pointers on how to include links within table results that point to additional information also pulled from the same db table?

I have some extensive info that I want to query. The intial results are going to be displayed in a simple wire frame html table layout. I would like each row to include a link that will take the reader to a more detailed version of the data for that particular row, and that more detailed data will of course come from the same db table. My problem is I don't know how to setup the code to create such link.

Output Results In Link Form
I have script that includes a query that should output a link. The link is actually an image. So from the table it will get "image.jpg" while i will be providing the full href for it so that i becomes a link. My question is how do i use PHP (or PHP with JS to open up the image according to the image's size. Thus i dont need to define a fixed size always. PHP Code:

Where Should Add 'http://' In Display And Link Stmt
echo "<td width="35%"> <FONT SIZE=-2 FACE="sans-serif"> <A HREF=".$row["homepage"]. ">" . $row["homepage"] . "</A></font></td>";

how to add 'http://' in <A HERF....".

Looking For A PHP Script That Will Call A Link By Record Number
I am looking for a script, or at least the logic behind this if anyone can help me. I keep my website records/links in mysql database. Curretly, I display them as is, being if you mouse over the link, the actual link can be seen.

What I want to do is, have just the record number included in the link where the link can not been seen when you mouseover. When the link is clicked, a PHP script will go to that record number, extract the link from the record, and open a window to the link. Is there an avaiable script out there to do this? If not what steps are need to accompish this?

How To Count The Number Of Times A Link Is Visited
how i can get the total number of times a particular link has been visited.for example:this is the link.

www.abcd.com/upload.php?id=761786717.jpg.

i want to display how many times this link has been visited

Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up.

I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:

Navigating Database Results And Problem With Link
I am loading results from mysql database and displaying on my page and then dynamically displaying only 5 results per page. On each page I have a POST button so that if user wants to POST something on form he should be able to do it whether he is on page 5 or page 1. When I first time loads the results on page 1 this POST button works fine but when I go to page 2 and click on POST it gives following error

"
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
"
and then even if I go back on page1 it starts giving me same error.

Making The Results Of A Search Engine Show As A Link
I made a simple PHP search engine for my web site. the problem I'm having is that the results show as regular text rather then a link to the page found. I need to know how you use A HREF with a variable. below is the section of my code that I figure I need to modify.

$row = mysql_fetch_array($result);
echo ($i+1).'<strong> URL: '
echo stripslashes($row['url']).'</strong>'
echo '<br />'

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.

Check Date And Time And Display A Link Between Certain Hours
I need to write a PHP script that can check the date and time, and if it falls in between certain hours to display a link, and if not display another link.

The application is for a realaudio broadcast which goes live 7-9pm every wednesday. If it's not "live" then the link would be to the archive from the previous show.

How To Display Data From Same Query On Diffrent Pages Using Next Link?
When i run query i am getting thousands of records and i am displayaing
a particular no. of records on a single page say 100 records then i put
a link to go on next page. when user clicks on next page the another
100 records will be displayes so should i need to run the query again
to get records from 100 to 200 records?

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.

Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?

Determine If User Came From Inner Link Or An Outside Link
any php method or function to determine if a user came from within the website or from an outside website. I have a page that I want to display in different manners depends on how did the user arrive at my site.

I know about the HTTP_REFERER function. but don't really know how to use it. I know this is the syntax:

<?php
echo $_SERVER['HTTP_REFERER'];
?>

but when i entered the code in the php page. for instance test.php, there is nothing coming up. So my questions:

1. is there any other method?
2. could any of you maybe specify a bit more details about this function and how to use it.

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?


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