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




How To Display Data From Database In Different Web Pages?


When we get data from database by use mssql_query(),suppose the data is very large ,it has many rows, and we want display the data in different web pages like many search engines do, my question is how to do that using the same result without call mssql_query() again?




View Complete Forum Thread with Replies

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

How To Display Mysql Database Information In Multiple Pages?
how to display mysql database information in multiple pages? i would like to display all my member with consist of 400 people and i wan it list in mulitiple pages, and contain a "delete tick" for me,and when i click the member, can redirect me to member detail imformation. it just similiar to email pages of yahoo inbox.

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?

Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions,

1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6.
2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?

How To Display The Record Into Pages?
I'm having (for eg., 22 records) in my MySQL table. I want to display these 22 records into pages, each page contains 5 records. so 5 pages with each 5 records and the last page contains only 2 records, and Previous and Next links in each page.

I've used LIMIT in select statement. But i dont know how to use this exactly.

Using PHP & MySQL To Display Web Pages
I am a real novice to php and MySQL, with about a week's worth of
reading and self tutoring. I have an urgent need to publish a
database of information and need some guidance on how to do this.

This question might be more suited to a MySQL newsgroup, but since php
and MySQL seem to have become almost married to one another, and since
getting the data out and displaying it is where my problem seems to
lie, I thought I would start with this php group.

The problem is I can not figure out how to put information into a
MySQL database and get it out and correctly dislay it for the web.
More correctly I have two types of data I need to get in and out.

1. I have some web page content, not inlcuding borders, that is in
html format. So I have tried saving the html code, which looks
exactly like the code when you "view source" on a web page, into MySQL
and getting it out. I can get it out, but I have not figured out how
to make it act like html, i.e. to be interpreted by the browsers.
Instead it comes out looking exactly like html code. It is not being
interperted by the browser.

2. I would prefe instead of typing in html code for the content of a
page to type in instead the text, tables, lists, etc. Here is where
my problem lies, how do I input to MySQL relatively simple web pages
that may have a table, a list, some links, a picture?

3. How do I call up and use the data from MySQL an dget this to
display for the web?

By the way, I have been learning css, so I would like to use this if
possible. If not, i.e. if the formating mechanism for getting content
into a database precludes having it formattted by css on the
publication sie, then that is ok. I can live with that.

Retrieve And Display 3rd Party Pages
I'm wondering if you can show me an example php page that allows me to
retrieve and display 3rd party pages. I.e.,

when my php script is called as http://site/path/getit.php?file_key
it can retrieve from http://3rd.party/path2/name-with-file_key.htm
and display the result back to the browser.

I don't know php, and start to learning it. So I hope you can give me a full
php page, not a segment. I don't think it'd be too long though. Luckily, I'm
a programmer, so you don't need to comment it much, unless it is too
convoluted.

Further, if you can throw in handling of gzipped files, that'd be super.

If you have Firefox,

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.

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.

Background Colors On Display Pages
Is it possible to display table data using a while loop, yet have each output row with a certain bg color depending on a value within that row. For instance, if I'm dislaying the incomes of various businesses, I want to show the business with a positive income with a green background, and the business with a negative income with a red background. Is this possible?

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)?

Pages Not Refreshing With New Data
My application web pages are not refreshing with recently submitted updated data. After a user submits infromation into from a form into the database, I have the user redirected a "veiw data page". The new information is not on this page until the user clicks refresh on the browser. I've added the meta tag that keeps pages from being cached (NOCACHE), but this doesn't seem to help.

Saving Data Between Pages
Is it possible to save session values between pages? I did a little script
to let the users login. I use this script to check username and password the
user introduces in a form in the main page, index.php.
If a user is found with username and password, than I create
$_SESSION['Login'] and assign it a value of true, else I assign it a value
of false. If a user is non registered, I send it to the proper page to
register, RegistraUtente.php, if he is registered yet, I send him back to
index.php
But here in index.php $_SESSION['Login'] has no value.

Here is the script I wrote:

<?php

session_start();

include("dbconnect.php");

$tabella="table";

$dbname="Zucca";

if (!isset($_SESSION['Login']))

{

$_SESSION['Login']=false;

}

$IdUser=session_id();

$data=date('Y-m-d');

if (!ISSET($HTTP_COOKIE_VARS["PiOnLine"]))

setcookie("PiOnLine",$IdUser,time()+60*60*24*365);

else

$IdUser=$HTTP_COOKIE_VARS["PiOnLine"];

mysql_select_db($dbname,$db);

$username=$_POST["username"];

$password=$_POST["password"];

$query="Select Username, UserPassword from $tabella where
('$password'=UserPassword) and ('$username'=Username)";

$result=mysql_query("$query") or die(mysql_error());

// Se esiste l'utente con username e password allora consenti il login

if (mysql_num_rows($result)==1)

{

$_SESSION['Login']=true;

session_write_close();

$url="index.php";

header ("Location: $url");

}

else // Invia l'utente sulla pagina di registrazione

{

$_SESSION['Login']=false;

session_write_close();

$url="RegistraUtente.php";

header ("Location: $url");

}

?>

Sort Pages Of Records From Database
When I sort dates from my sql database, the records sort all in one time.I would like to sort only 20/25 records and after to clik a button and sort other 20/25 records and so on.

How To Make A Database Connection Available To All Pages?
How can I make a database connection available to all the pages in my
application? I tried doing it with session but it doesn't seem to work.

here's what a did:

How To Obscure Database Info In PHP Pages
I'm moving from Cold Fusion to PHP and I have a question that none of
the books I have answers adequately:
In Cold Fusion, database connection parameters like the table, username
and password are configured on the server. Since they are at the
backend, nothing is exposed on the page except the queries themselves.
In PHP, from what I see, the database info is on the page. Is this not a
security risk? How can one be sure that this info is not on the page
sent to the user?

Passing Data Into Generated Pages
I have a template page with items being displayed on it and the idea is when a user clicks that item it's item id gets passed into the next page so that it can be compared against the flat file database and then when matched displayed the item information.

I'll show you how i am displaying items on a page and then i'll show you the code i have developed so far to try and get the item id to pass pages and display the item details. Code:

Linking Data And Generating New Pages
i have seen websites that have data stored in databases and when a link is clicked a template page is generated with the data instead of having a separate page for every single item associated with a user. The address bar when clicked will look something like this:

http://www.blahblah.com/user/index.php?id=view&&1918373707

I have two flat file databases. One, categories with the structure --> username|catname|catid and the other content with the structure  --> username|catid|date|text

I need some code please that will make a link between the 'catid' in both databases and then do that URL thing above to link to a generated page (or template page) where i can then echo out all information. I will post the code to show you how i am producing the links that i want people to click. Code:

Database Driven Pages On Search Engines
I know this has been discussed at length in these forums from the searches that I've done, but I have a new question of sorts. Basically, I found several solutions to the problem of using PHP/MySQL database driven pages and getting them listed on search engines. One method that I've chosen entails listing the variables in between backslashes after the name of the document, like this http://www.something.com/index.php/test/1234

After a few problems, I've been able to get all of the pages in the first group (I just added the 2nd and 3rd group today) to list perfectly on Google. I'm psyched about this working on my entire database of 10,000+ products, but I'm worried that I may be overlooking something.

If possible, please check out that link and if anyone knows of any shortcomings or pitfalls with using this method, please let me know. Thanks a ton.

Call My Html/php Pages From A MySql Database
I wanted to call my html/php pages from a MySql database. But when I view the data in the table on my site it just shows the php statements as text. Is there a way to fix this?

PHP Script To Generate Static Pages From MySql Database.
I need to create static pages from a database and I cannot find such a script. 
The script must be able to create a static page from every record in the table and give it a URL and also create a static index page with links to the pages created from the table.

PHP Script To Sort Data/create Pages According To Fields?
Someone fills out 3 fields. (There will be more but this is just to
give you an idea)

1. Country
2. State
3. City

I want this script to generate a web page and list the people by
information submitted.

eg. Everyone that put in USA will be listed on a page.

or

Choose California and everyone that typed in California will be listed
on a page.

I can also create links with criteria at the end. eg.
mysite/search.php?=montana

This script will also accept data from people. So people will visit,
type of the form and if the information is valid (not spam) then
they'll be in a database and able to be sorted.

Looking For A PHP Script To Sort Data/create Pages According To Fields.
eg.

Someone fills out 3 fields. (There will be more but this is just to
give you an idea)

1. Country?
2. State?
3. City

I want this script to generate a web page and list the people by
information submitted.

eg. Everyone that put in USA will be listed on a page.

or

Choose California and everyone that typed in California will be listed
on a page.

I could also create a link with the search term at the end. eg.
mysite/phpsearch=?montana

This script will also accept data from people. So people will visit,
type on the form and if the information is valid (not spam) then
they'll be in a database and able to be sorted.

Database Display
I am calling all fields from a table, just to many to call the ones i need. I would like to drop the first 2 from being shown, how can I do that by the code below or do I need to rewrite completely?

while ($line = mysql_fetch_array($store_data, MYSQL_ASSOC))
{
     foreach ($line as $data)
     {
          echo $data . ', ';
     }
}

Display Database Record
i have a php script that read from mysql and display then in textbox.
I have problem with the way textbox display the data.

<input type=text name="package_name" size=20 maxlength=10
value='.$package['package_name'].'>

when the package_name is 'china tour' it will only show china in the
text box. How can i show all the content of the record?

Display A Div Only If A Value In Database Is Equal To 1
Im trying to get a div to to only display if the the row in the database called "stock" is equal  to "1" if it is equal to "0 " then do not display the specific div.
Here is the code:

Display Then Update Sql Database
I have an html drop down list that I have populated from a sql database, a selection is made and the information on the selection retrieved from the database and output in text forms on another page. I want to be able to edit or add data and then update the database. Code for the second page is below.

I have echo'd the post variable and it does make it through. From what I understand the post variable is being removed when I submit the second form and so it all fails. How can i sustain the variable from the first page? Code:

Image Display From Database
i have one problem in my programming.there is a table containing some details of the product with its image.. in view section in my php page ,i need to show this image and the rest of the fields in the table in a row...

Display Data Without While Loop
Can data in the database be displayed without using a while loop. Obviously only one record will get displayed.

mysql_select_db("db", $con);
$result = mysql_query("SELECT * FROM details");

while($row = mysql_fetch_array($result))
{ echo $row['FirstName'] . " " . $row['LastName'];
  echo "<br />";}

Display Data From Db Is Slow
I am trying to pull data from my database from 2 different tables and it seems to slow the page down a lot the way I did it. I was hoping someone can show me a better way to do the same thing but with faster page generation time. Code:

Display Data On Page
Ive got my page set up correctly as far as getting data into the database goes however I am not sure how to display it all on the page.
Basically I have a news table: news_id, club_id, title, news

I would like to display all the news items associated with the club that the user is logged into.

Id like each news item to be separated so that its easy to identify they are different news items e.g.

__________________________
$title
$news
__________________________
$title
$news
__________________________

Sorting Display Data
Here's the situation:

On our Golf Leaderboard, when scores are submitted, the actual numerical scores are to be sorted from lowest numeric value to the highest, while the 'over/under par' values are sorted from highest to lowest. This works just fine when only TWO scores are submitted, and displayed.

Anything over 3 player scores, it reverses the sorting of the data stated above.

Here's the PHP file: (I consider this script 'short' - I hope it falls with the parameters mentioned by the staff) Code:

PHP Pages Display In All Windows Browsers And NO Linux Browsers!
OS: Windows XP, Windows 2000
OS: Linux Red Hat Enterprise Level 3, Fedora Core 3

Browsers: Firefox 1.0, IE 6.1+, Mozilla, Konqueror

We are working on an internal website that is to be used as an
intranet. This page goes through an initial SSL layer after asking for
certificate acceptance, once you acccept the page should pull up.

And here is the problem: It pulls up under any browser within Windows;
it never pulls up under any browser within Linux. This includes
Firefox; it's fine in Windows/Firefox but locks up cold in
Linux/Firefox.

Which Tool To Use To Create Form For A Database? How To Build A Interfaces (or Web Pages) In Easy Way?
how to build a interfaces (or web pages) in easy way? how to build a form in easy way? how to automate and create web pages with a tool? which tool to use to create form for a database? I mean there is a way or a tool which help me to build an interfaces (web pages) to deal with the data in a database?

How To Connect To Database And Display It In Flash?
how can i connect to mysql database and display the data in flash?

Don't Display Duplicate Database Entries?
I have a restaurants database that has a lot of restaurants listed with the same name in the same city with only the category changed. This is the code that I have that displays the list of restaurants. Can someone tell me what to add to it so that it will only display one of each restaurant of a certain name? PHP Code:

Display The Latest Database Entry?
how I can display the latest database entry? PHP Code:

Trying To Display Image From Mysql Database
I have a mysql db, that holds images.
Images are encoded using base64_decode/encode, etc. Image data seems
fine.
I have a view.php page that is supposed to show the image, and an
image.php page that accesses
the database, retrives the image data, and then (theoretically) prints
the decoded data to the page.
below is the view.php page code: problem area the img tag src no
worky.

What am i missing (having stolen the idea for this from the web!!!!
thanks,
eric
/************************************************** *****************/
<html>
<head>
<title>Get The Image</title>
<link rel="stylesheet" type="text/css" href="css/csssmall.css" />
</head>
<body>
<center><img src="testimage/Sunset.jpg" width="300" border="1"
alt="Image of Sunset"></center>
<p class="para-color"><?php echo 'Beautiful Image' ?></p>
<br>
<center><img src="image.php?img=3" width="200" border="1" alt="Image of
Thelma Todd"></center>
<p class="para-color"><?php echo ''Nother Beautiful Image' ?></p>
</body>
</html>
/************************************************** ****************/

below is the image.php code:
/************************************************** ********************
<?php
$dbhost = 'localhost'
$dbuser = 'auser'
$dbpass = 'apassword'
$dbcnx = @mysql_connect($dbhost,$dbuser,$dbpass);

if (!$dbcnx)
{
echo( "connection to database server failed!");
exit();
}
if (! @mysql_select_db("portfolio") )
{
echo( "Image Database Not Available!" );
exit();
}
?>
<?php
$img = $_REQUEST["img"];
?>

<?php
$result = @mysql_query("SELECT * FROM images WHERE id=" . $img . "");

if (!$result)
{
echo("Error performing query: " . mysql_error() . "");
exit();
}
while ( $row = @mysql_fetch_array($result) )
{
$imgid = $row["id"];
$encodeddata = $row["sixfourdata"];
$title = $row['title'];
}
?>
<?php
//echo $encodeddata;print??
echo base64_decode($encodeddata);
//echo $prefix . $encodeddata;
?>
/************************************************** ***********************

Display Randomized Questions From A Database?
I would like to store 300 questions in a MySQL database, and configure a webpage to display them in groups of 50 at random, then store the responses. Could anyone recommend a script or strategy to do this please?

How Do I Display All Database Entries Between Two Dates
I have two dates in a form " startdate" and enddate"

when i display the results i would like to show all results between, and including the two dates. how do i do this... this is my current query:

My Variables:

$userid = $_GET['idr'];
$fromdate = $_GET['fromdate'];
$todate = $_GET['todate'];

The query:

$result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' ORDER  BY time");

Display Entry From Database To Browser
I can't display entry from database to browser, what's wrong with my code? Thank you for your kind attention. Code:

Function To Display Form From Database!
I'm trying to write a function which gets all the client names from a table and displays them in a drop down list. My function is displaying a form with nothing in! Code:

Linking Tables To Display Data?
I want to link two tables together to create a list. The unique value
loppnum appears in both tables. I need to look up its corresponding value
for each entry.

table1 has 2 cols
A Jag
D Cht
E Lio
P Mkn
Q Res

table2 has 2 cols
MN A
PL D
RT E
PO P
LM D
NB D

In the first table both values are unique
In the second table the first value is Unique

Now I need to display a list of data in this form

MN Jag (Displays second table data and looks up value of A in first table)
PL Cht (Displays second table data and looks up value of D in first table)
RT Lio (Displays second table data and looks up value of E in first table)
PO Mkn (Displays second table data and looks up value of P in first table)
LM Cht (Displays second table data and looks up value of D in first table)
NB Cht (Displays second table data and looks up value of D in first table)

I have made a start

$upgcollect='SELECT * FROM table1 ORDER BY scfmfor'
$upg1=mysql_query($upgcollect);

$ml_collect='SELECT * FROM table2 ORDER BY loppnmn'
$upg2=mysql_query($ml_collect);

That gives me two variables with complete table data.
The rest of this is beyond me at the moment.

Display Data With Nice Border?
I'm using PHP since a few week. I like to know how php programmers are making
so nice border to displaying MySQL table?

I like to make a border with rounded corner.
Could somebody tell me how can I do that?

Trying To Display 1 Row Of Data On Static Web Page
I have a database with about 600 rows of data, and about 40 fields. I want to display 1 row of data at a time and populate it into a static web page in misc areas on that web page.

I am having trouble displaying the results! Do I still need a loop even though I want one record at a time? Code:

Display Binary Data From A Function
I am trying to retrieve binary data (a JPEG or GIF for this example) from a function and display the data on a seperate page. The function is held in a file called getdata2.php and looks like this. PHP Code:

Display Mysql-data In Flash
How can I display mysql-data in flash?

Which String() To Use To Display First 500 Words Of Data.
I have a table of large documents in mysql [text]. I want to use some sort of string() to display only about the first paragraph (or 500 words) to the user. (a preview). Then at the end have a ...(click here for more) link to the rest of the document. Which functions should I consider?


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