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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How Do I Alter This Script To Show 5 Rows Per Page?


I'm very new to php/mysql and am having a few problems I would like to show five rows of data then have a link to next five / previous etc.

I've included the script I have below. I would like to add I have found articles on how to do this, but my problems is i don't knowwhere I should be editing the below code. I have tried several examples but just keep getting errors. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Can U Alter A Sess Variable Twice In The Same Page?
in a project i have a session variable which i always reset in header and if needed i put a value after.

in FF works in IE 7 work's on login page not in another (both are combined with AJAX but in second case the re-assigining does not work despite is shown on echo in browser it's not written in php session file);

View Replies !
Creating Configuration Page To Alter Config.php
I'm creating a web-based database thingy for the organisation I work with- and of course there are a bunch of variables that I don't want to be touched by end-users, but then there are a few that I do want to be changeable by a 'super-user/moderator.'

I'm trying to come up with the best way to create a 'configuration' part of the 'admin' section, which has the options to change, which will then open the particular file (let's say config.php) and edit those particular variables.

View Replies !
Loop - Show The First 10 Rows Only
I have the below code that is pulling all rows out of table and then listing them in a table. But I only want it to show the first 10 rows only, and not sure how to cap it at 10. I'm currently using a while loop as follows:<?php
while ($stat = mysql_fetch_array($result))

{ ?>
<tr class="<?php if ($rownum%2) { echo "line_2"; } ?>">
<td>
<?php echo number_format(($stat['Rating']), 3); ?>
</td>
<td style="text-align:left;">
<a href="index.php?page=profile&pid=<?php echo ($stat['id']); ?>"> <?php echo ($stat['login']); ?></a>
</td>
</tr>
<?php
echo "
";
}

View Replies !
Keyword To Show All Rows From A Fulltext Index?
I have a pulldown menu that has values that correspond with keywords in a column in a table of Pictures in my database. For instance if the user selects the option value, "Animal" and relists the page, the only pictures shown will be animals.

I did this using MySQL's FULLTEXT feature, but I'm having trouble getting all of the images to show at once. My question is this: Is there an easier way to have one keyword (perhaps something like a wildcard?) display all the images in the table instead of adding "ALL" to each row's list of keywords and using that in the "All Pictures" value in the pulldown menu? I tried using just option value="%", but that didn't work at all.

My second question is, a lot of people seem to add wildcards around their variable, (e.g. %$catselect%). I know this is used mainly for if the keyword is input by the user, but what exactly does that do? Make it so that if they typed in "Animals", it would still find the keyword "Animal"?

Last, does anyone know when MySQL 4 is supposed to come out, or at least be in beta? Working without boolean searching is a real pain in the foot.

View Replies !
If Value =1 Direct To Page Otherwise Show Data On Page
In the member account area there is a button saying (list) when the member clicks this they are redirected to add.php here i am wanting to check if a members account is limited, if it is direct them to a page saying you must pay your bill. if its not display the info on the page.

in the database there is a field called limited which is tiny in if its not limited the value of the field would be 0 if it is limited the value would be 1.

View Replies !
If Page = 'about' Show The About.html Page?
I wanted to do some kind of PHP script so that if the current page the viewer is trying to view is called index.php?page=about then it will use the php script to embed with an i-frame the about.html file into a cell in my web page's table. Basically, so that the whole page stays the same other than one cell of the table which is dynamic depending on the status of the index.php?page=whatever. Code:

View Replies !
Show Some And More On Next Page
I'm stuck making my log for login sessions show only 50 per page. The reason I need this is because it will only display about 250 items before not updating/displaying anymore.

If anyone has a link to a tutorial, that would be super- couldnt find one via google.

View Replies !
Show When The Page Has Been Last Modified
1. I have php script that will show when the page has been last modified. How do I link it on my home page. The link that I am using now does not work. Here is the link:
<? include("updatepage.php"); ?>

2. I have a php forum. When I link it this way <a href="xxxxx/index.php"> it brings up the source code. When I link it this way <a href="xxxxxx/"> it brings up the dir. When I link it this way <a href="http://xxx/xxxxx/index.php"> it works. How do I get it to work with this linking <a href="xxxxxx/index.php">

View Replies !
Why Does My Page Always Show JUST First Set Of Results?
Whenever I execute a query I limit it to lets say 2 rows per page. The problem is my code will only say there is 1 page of results when there should be more! What am I doing wrong? Code:

View Replies !
Show 20 Results Per Page
i have created a database with some data in it and i want my page to read page and display the first 20 results and on the bottom to add numbers like [1] [2] [3] so the user can go to the next results.I figured that i can display the first 20 results by adding a counter on the while loop

$num_rows = mysql_num_rows($result);
$k=0;
         while (($k<=20)&&($row = mysql_fetch_row($result))){
$k+=1;
$i+=1;but i don't know how to display the numbers on the bottom.Here is my try
<?php for($j=1;$j<=($num_rows/20);$j+=1){
  echo "[".$j."]";
} ?> ...

View Replies !
Flash .swf Doesn't Show In PHP Page
I've recently put together a flash navigation for a 4 page site... three pages are HTML, the index page is PHP with a weblog. In all current Mac browsers, all four pages load fine. In Win IE 6 only the .shtml pages will load the flash--the .php page shows a big white box instead.

If I include the index.php in the index.shtml file, the flash loads fine, but I'd like to know if there is some issue with PHP & flash that I should look out for... or is the issue with IE 6.

View Replies !
Show Image On Same Page
I echo a certain amount of images, these images are thumbnails. I want to be able to show the real enlarged image next to the thumbnail without having to reload the page. So what i'm thinking of is something like the onclick function in JS. I tried some stuff but still can't make it work. my code is something like this:

for (i=0; i<count($test); i++){
echo "<a href="...."><img src="$test[$i]"></a>";
}

tried putting a javascript function in there but wasn't successful. i basically need to pass just $i to another function and that function onclick() will produce the image.

View Replies !
Show Home Page On Log In
I want to have a homepage with a log in feature. But I want it to say 'You are not logged in" or "you are logged in" depending on whatever is the case. I know how to check db entries etc but should I have the php on the same page in order to position the welcome note ie:

<?php echo "<p>Welcome $_SESSION(username), to my website</p>;?>

View Replies !
Show Page Depending On Request Url?
Is there any way to show a different page depending on the request url? I have a few domains that point to one IP address. What I want to do is if someone requests

http://www.site1.co.uk they see site1.php or
http://www.site2.co.uk they see site2.php etc

all from the root directory? I do not have httpd.conf access Is this possible?

View Replies !
Dont Show Update Page
I dont want people to see my update script more like when they press update the page will refresh with the new entry..

View Replies !
Show Number Of Visits On Each Page...
How should i do when I want to show number of visitor on each page where each page is describing a user details like this:

http://localhost/user.php?user=1 on this page it show details about user 1. And for user_52 I want to show how many visitors this user have had: http://localhost/user.php?user=52 it will show number of visits

View Replies !
Show Error Message On Same Page
I have Index.php which contains the HTML form with a username and password field + submit button, action: is my check.php.

Say for example the user only input's a username and miss out the password field; when he clicks the submit button. I want the same page to be refreshed with a error message appearing below the submit button saying "error, please fill all in". I can get this to display on another page. but want this to be on refereshed on the log-in page.

View Replies !
Show Page Break In Records
I've just started to learn php and sql, and I noticed that there are
several php discussion groups here. Pardon me if this is the wrong
group, and I hope my first question isn't too silly. :-)

I'm building a website that will publish articles, so I have an
article table which contains a heading field, an ingress field, and a
body field which will hold the complete article. There are line shifts
(or page breaks) in this field, but my display-page won't show them.
How do I show the article with the page breaks?

View Replies !
Thumbnails In Rows Of 4 Across The Page
how I can position thumbnails in rows of 4 across the page? I've tried so many code combinations my head's swimming. Most of them produced a vertical display.

View Replies !
Get 4 Columns And 10 Rows To Appear On Each Page
I have a page that has 10 rows appear on it, but I also want 4 columns (not just 1). I was wondering if someone could tell me how I can go about and get 4 columns and 10 rows to appear on each page. Code:

View Replies !
How To Sho Video Clip On Web Page Also A Live Show On Web
Indeed I am using php and Mysql.

My licent want to
1. Show a video clippings on the web site.
What I need to do ?
Please elaborate a n example will be great thing.

2. He also want me to show live telecast of a seminar
What arrangement I ned to do
From hardware point of view as well as Software point of view.

View Replies !
Urgent Please Help (how To Show .doc File On An Html Page)
i have uploadeed a .doc file into server now i want to show it on a
page
how can i do it

View Replies !
Show Postings From A PHPBB Forum On Another Page
I want to show the 3 latest threads in a phpbb forum on another php
page, but as I completely SUCK at PHP,

View Replies !
Page Load Time Show Really High
im running PHP 5.2 on IIS 6 (Windows 2003 Server) and im getting a weird load time result when trying to display page load times on each page. e.g. Page generated in 1193387528.5501 seconds. this is my current code:
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<p>Page generated in '.$total_time.' seconds.</p>'."
"; ?>

but i've tried 4 others which are all simular. Any idea as to why it's showing a false result as it's loading in unde 1 second (Dual Xeon 2.8 HT server and connecting over 100mb pipe (college campus)).

View Replies !
Get A Paragraph Of Text To Show On The Home Page Only
I am using a script that I purchased and downloaded. This script has a template folder and inside has header. php, and footer.php. The center content is populated from various other pages. How would I get a paragraph of text to show on the home page only, and no other pages in the script

View Replies !
Str_replace - Add Some Content On The Page To Show What You Have Submitted?
I had this wacky idea to have a pull down that keeps the same values when previewing what they have select in the post (ie. Webmaster World's 'Preview' Button When you post It has the same value of what u put in it when you add some content on the page to show what you have submitted) My Code:

$genre_pulldown = "<select name="genre" id="genre"><optgroup label="Genre"><option value="Yo Mama">Yo Mama</option><option value="Blonde">Blonde</option><option value="Political">Political</option><option value="Religious">Religious</option><option value="knock Knock Jokes">knock Knock Jokes</option></optgroup></select>";
if(!isset($_POST['genre'])){
echo $genre_pulldown;
}
else{
$genre_pulldown = str_replace('{$_POST['genre']}"', '{$_POST['genre']}" selected', '{$genre_pulldown}');//LINE 81
}

View Replies !
Default Error Page If No Rows
If there are no rows in the result of my query, instead of just showing some text in the browser saying no rows found, could i redirect to a standard error page using this function?

View Replies !
Pagination :: 10 Rows Per Results Page
I am trying my hand a pagination. There are 13 rows from the database which are being called. I have requested 10 rows per results page. The pagination says there are 2 pages but both pages contain all 13 rows. The limit of 10 is not working. Code:

View Replies !
Pagination :: Rows In Two Columns On One Page
I want to be able to paginate my rows in two columns on one page i.e.

Column 1 Column 2
row 0    row 5
row 1    row 6
row 2    row 7
row 3    row 8
row 4    row 9

<<Prev 12345 Next>>

This is the code I use. I found it and on Google, tweaked it and it works great.

<?php 


include 'dbmembers.php'; 

View Replies !
How To Show The Number Of Queries Executed For A PHP/mysql Page?
I would like to do some benchmark on my site...

Could you tell me how to show the numbe rof queries executed for a PHP/mySQL generated page?

View Replies !
Problem With Include - Register Page Doesn't Show Up
I am trying to include a page, but for some reason it is not working. Here is my code:
<?php

if ($page=="") {
echo "<center>Starbits Pets is currently upgrading to V2, so we will be down for a while, come back later!";
}
elseif ($page=register") {
include ("html/register.html");
}
else {
echo "That is not a valid location!";
}

?>

The register page doesn't show up I have tried almost everything I can think of, and it still doesn't work.

View Replies !
Show The Current Time At The Resort On His Home Page.
I have a client who owns a resort in the Philippines. This client wants to show the current time at the resort on his home page. How would this be done with PHP? Is it some calculation based upon GMT? I think (I'll have to check) that the Philippines is +8 GMT...so is that what you'd have to do: create a snippet that grabs the current GMT and add "8" to it?

View Replies !
Updating Multiple Rows With One .html Page
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying, that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Code:

View Replies !
Printing Number Of Rows Per Page To A Printer
Could anyone tell me how to go about the following - do I use css print style sheet or php.

I am using php and mysql to pull out and display records onto a webpage.  I have an option view all records that lists all records in the table.  I also have an option print all records.  However, my issue is when I go to print on some pages the information is split for example half the image on the bottom of the page and the other half on the top of the new page.

is there any techniques to force say 5 rows per page and then force a new page on the printer and print 5 more etc. 

I was going down the create pdf route but the file is large and user is left waiting for file to be generated.

View Replies !
Script Show The Requested Secure Page Apear In The Right Frame?
How do I have my formscript show the requested secure page apear in the right frame instead of popping up this page in a new window. I tried to fix it by writing " target=top" into the script line. Doesn't work ! Code;

View Replies !
Show On A Page The Date A Table In A MySQL Database Was Last Updated.
I am looking for a way to show on a page the date a table in a mySQL database was last updated. Does anyone know of a simple PHP (or similar script) that can do this for me.

View Replies !
Enter A New ROW After 3rd Image For 5 Rows And Then New Page For Remaining Results
I want to show 3 images per row and show 5 rows per page, that would be 3 images X 5 rows = 15 images. per page and then press next to go to next page to see if there are more images for that user. This is a script for making two users friends of each other. Code:

View Replies !
Showing Database Records As Links To A Page To Show Relevant Detail
What I currently have is list of players what I want to do is make each player a hyperlink to a page with their details on. The hyperlink would be like this www.mydomain.com/playerDetails.php?playerID=1 and it would display the player with playerID 1. I have seen this on lots of sites and would like to know how this is done, can anybody recommend me any tutorials or write me a short script to do this.

View Replies !
Dynamic Lists And Producing Rows On The Preceding Form Page
I have created the following dynamic drop down: Code:

View Replies !
Write A Simple Script Which Will Show Different Content On A Page Depending On The Week And Time
I am trying to write a simple script which will show different content on a page depending on the week and time (it needs to change at 5pm on Friday over the weekend) and I came up with this: Code:

View Replies !
Alter Box
ive written this if statement and i want an alter box to appear when the wrong username and password is entered...however i also want the page to redirect the user to the login page once they click ok the to alter Code:

View Replies !
Alter A Table
I have the following table with lots of data in it:

CREATE TABLE /*!32300 IF NOT EXISTS*/ [db_prefix]reference_lang_spr (
id bigint(11) NOT NULL auto_increment,
table_key int(3) NOT NULL default &#390;',
id_reference int(11) NOT NULL default &#390;',
lang_1 tinyblob,
lang_2 tinyblob,
lang_3 tinyblob,
lang_4 tinyblob,
lang_5 tinyblob,
PRIMARY KEY (id)
);

I would like to alter the table fields datatype for tinyblob's to text fields which is equalant in size of tiny blobs. I do have lot of data in the table. is it possible to alter the table.

View Replies !
Create / Alter A PDF
I'm having alitte trouble finding the right solution to my problem, so hopefully you can help me out.

I want to change some content in a PDF file with PHP. The way I tried was generating a LaTeX document and changing the text in there, before converting it to PDF, but since I need a specific layout including textboxes and stuff, I dont think LaTeX can handle that.

Another way would be generating the PDF directly with FPDF or PHPLib inPHP, but I think there will be a similar problem concerning the layout.

Do you have any ideas or advice?

View Replies !
Alter A Csv To Sql Script
I found a script on codewalkers, but needed to modify it. Its a csv2 sql converter. Below is my partly modified script.<H2>CSV to SQL convertor</H2> Code:

View Replies !
Alter Table
PHP Code:

ALTER table scanning_team ADD new_page text(16) NULL.

View Replies !
Alter Table Syntax
How do I write the Alter table clause on Mysql if I want to add on delete cascade on a table.

View Replies !
PHP To Alter Flash Movie
I'm not sure if I've posted in the right place, so feel free to let me know if I haven't.

I've a situation where I would like to modify values in a flash.exe using PHP where flash.exe is a flash movie which is download and runs on the client side.

The reason for this is, I've an online form where I want the values to be submitted to an app for users to download. Each time the user runs the app on their machine it should have the values that they submitted online. Is this possible?

View Replies !
Alter The Order Your Colums Are In In The DB
How do you alter the order your colums are in in the DB. I forgot to put my ID in at the begining and It's just easier to look at with it up there.

I think my productivity today is at an alltime low.
I even had to look up how to escape special charicters, the date() function, and how to write for() statements.

It's like everyting I know aboult mySQL and PHP decided to take the day off. I even made myself look like a fool infront of one of our directors.

View Replies !
How To Alter Syntax For This Form
How can I rewrite this code so that it works in the form below? PHP Code:

View Replies !
Alter A MySQL Column With Php
I have a table named sentcards with a field called cardid with a current type int...
I wish to change the type int to bigint(30) with an attribute that is unassisgned and a default of 0... This is my code:

View Replies !
How To Alter Last Iteration In A For() Loop?
Currently I have a for() loop building a query for me. The code is as below
for ($i = 0; $i < count($array); $i++) {

//removes characters in $chars from $array items
$chars = array(" ", "&", "(", ")", "/", "-");
$trim = str_replace ($chars, "", $array[$i]);

$query1 .= "$trim, ";
$query2 .= "'$" . "_POST[$trim]', ";}

$query1 = str_replace ("_1", "", $query1);

$query = "INSERT INTO 2007_results (name, email, ip, $query1) VALUES ('$name', '$email', '$ip'," .  $query2 . ")";
mysql_query($query);

This is producing a $query that looks like this--
$query = "INSERT INTO 2007_results (name, email, ip, query1.1, query1.2, ) VALUES ('foo', 'foo@bar.com', '127.0.0.1', 'result1', 'result2', )";

Obviously that is producing a SQL error because of the extra comma and space inserted at the end of each iteration.  The question is, how to remove the inserted ", " on the last iteration?  There are many more inserted vars as part of $query1; I just shortened it for this example.

View Replies !
Using ALTER TABLE And FULLTEXT
I am running the following:

mysql_query("ALTER TABLE reviews ADD FULLTEXT (title)") or die(mysql_error());
mysql_query("ALTER TABLE reviews ADD FULLTEXT (body)") or die(mysql_error());
$result = mysql_query("SELECT movieId, title, MATCH (title, body) AGAINST ('" .$row['title']. "') FROM reviews WHERE MATCH (title, body) AGAINST ('" .$row['title']. "')") or die(mysql_error());

but I keep getting the error "Can't find FULLTEXT index matching the column list". Is my syntax right on the first two lines? This is going to be used to gather related articles based on the currect articles title and echoed as such.

View Replies !

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