Displays 5 Posts Per Page In Descending Order
I have been doing up a website which will, among other things, display news that I input into the MYSQL database. I have a working version of this where it just displays 5 posts per page in descending order (the latest at the top of the page) with the page numbering underneath them.
Now what I wan't to do is just dispaly the latest 5 posts on the page but, I want to dispaly them so that I can put in a Javascript function to maxamize and minimize each post by clicking on the title.
So, I have, ID, Title, Newstype, Author, Post, Date. In my mind I see this as display each of these using the COUNT(*) thing and just subtracting 1, 2, 3, 4 to get the 5 posts I want. I just don't know how to do it.
View Complete Forum Thread with Replies
Related Forum Messages:
Order Descending
I am getting info from d/b and ordering like this: ORDER BY points But I want the team with the most points to be 1st, so I need to sort descending.
View Replies !
PhpMyAdmin Order By Descending
Is there a way in phpMyAdmin to set it up so when I enter a record it goes at the below the previous entered record? So that the ID is descending? I couldn't find anything on the home page about default settings. I am using phpMyAdmin - 2.10.0.2.
View Replies !
Sort The Data Normally And Descending Order?
Im displaying data from a mysql query that displays a Player, email, id etc.. and I have links that sort the data by player, email, id etc... But Ive seen websites where you click sort and it will sort the data by that and if you click it again it will sort that data this time in descending order. How am I able to have link that will sort the data normally and descending order?
View Replies !
Sorting Output In Descending Order
I am trying to get the top ten people with the highest comment count listed in descending order. The code below is what I have started which basically sends the amount of comments for each user to a variable $count. Now I am struggling to display the output with the highest $count number at the top descending down to the lowest and I only want the first 10. Code:
View Replies !
List Filenames In Descending Numerical Order, But Also Ascending Alphabetical
I am trying to write a script that lists the filenames in a directory in descending numerical order, followed by ascending alphabetical order. For example, I have the following filenames in a directory: 20070317_Pear.jpg 20070421_Kiwi.jpg 20070423_Grape.jpg 20070519_Apple.jpg 20070519_Banana.jpg 20070519_Orange.jpg My desired list order is: 20070519_Apple.jpg 20070519_Banana.jpg 20070519_Orange.jpg 20070423_Grape.jpg 20070421_Kiwi.jpg 20070317_Pear.jpg So, within a group of files that begin with the same number, I'd like the files to sort in ascending order by alphabet, rather than descending order. Here's the code I've attempted. It sorts numerical in descending order, but won't sort alphabetically in ascending order: Code:
View Replies !
Order By - Displays Numbers Before Letters
I have a database query that retuens the results correctly, but i need to do an order by clause. When i do this it displays numbers before letters, whereas i need to display letters then number e.g Jobcard No Page No. PRE001 page 1 PRE002 page 1 POS001 page 1 POS001 page 2 POS002 page 1 455101 page 1 455101 page 2 455101 page 3 567070 page 1 etc, etc, etc, the field Jobcard No. is a Varchar i think i need to changed to asci and Order By that way.
View Replies !
MySQL Query To Order By User's Posts Instead Of Name
I have a script for users who post articles. The script shows the list of users ordered by name but I would like to order it by number of articles written. I was hoping if somebody can help me figure out the change in the code to do this. I thought I could just change the ORDER BY argument in the query but the coder wrote it differently because the posts are in a different table, so I am not sure how to do it. Here is the code:
View Replies !
PHP Script That Displays Another Page Partial Content
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in the URL-link associated to "Go") you will obtain this string: "Version: RM43_V1.10.030" Is it possible to have a string.php page that just display this string?
View Replies !
Script That Reads My Log File And Displays It In An HTML Page.
I have a problem. I am trying to make a script that reads my log file and displays it in an HTML page. I got the base code from a book, being that I am still learning PHP and I needed a little help starting out. But the code I am using gives me an error. The error is : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 15 It ranges from to line like so : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 27 I want to know if anyone knows the specific reason or maybe a place to start at to find out the problem and the solution.
View Replies !
Developing A Page That Displays Latest 5 Images In A Database
I am currently changing my web site so that it is PHP and mySQL powered. On the front page I have an area that will display the latest images in my portfolio and the latest text description. Therefore, what I need is an admin page which allows me to upload images to a database which has a timestamp/date field, a thumbnail field, an image field, a text field for the title and a text field for the description. I also need a HTML form with inputs for the thumbnail upload, image upload, title and text description (in a textarea). It would also be useful to have the page display the database contents and allow me to edit the details and also, delete rows. I then need code for that will display the most recent 5 thumbnails and the title on my index.php page.
View Replies !
Displays Page Will Not Parse Till The Sql Query Is Finished.
I had PHP 4.3.3 running before I updated. When a page was loading, all the php/html that was doing simple prints of tables and images would load while an sql query was running. When the sql finished, the rest of the page displayed. I have now updated to 5.2.3 and when I go to the exact same page, nothing displays until the sql has completely finished. The issue with this whole thing is the javascript I had loading on certain pages that displayed an image telling the visitor "please wait, processing..". This no longer displays since the page will not parse till the sql query is finished.
View Replies !
PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example: index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>. I've done this before, but I can't remember the code I used.
View Replies !
MySQL Query - Page Which Displays A List Of Orders
At the moment I have a page which displays a list of orders, with the following query: Code: <?php mysql_select_db($database_connOriental, $connOriental); $query_rsOrders = "SELECT *, date_format(OrderDate, '%d %M %Y') as formatted_date FROM Orders INNER JOIN Customers WHERE OrderCustomerID = CustomerID ORDER BY OrderID ASC"; $rsOrders = mysql_query($query_rsOrders, $connOriental) or die(mysql_error()); $row_rsOrders = mysql_fetch_assoc($rsOrders); $totalRows_rsOrders = mysql_num_rows($rsOrders); ?> .........
View Replies !
Make Posts Continue On Another Page?
I'm was wondering how I could make it so that after the first 15 posts it continues on another page for 15 and then another and another? Kind of like the system here. When a certain amount of posts are on a page it creates a page two to continue with the posts..
View Replies !
Page Cannot Be Displayed While Attach Images To Posts
i am including the ability for users to attach images to their posts. Now they can attach more than one image. First time round. the image gets uploaded and everything works fine. second time round though. i get a 'page cannot be displayed' error. The address in the address bar is correct. i just cant see why its working first time and not second. Anyone experienced this before or myt know why its happening?
View Replies !
Add Recently Added Posts Etc To Front Page
I am running a forum and now want to create another front / homepage where i can have other stuff related to the site as well as displaying recently added posts from the forum. I have looked in the database for some sort of date or time that a certain post has been posted but doesnt make sense, it doesnt look like a sort of time and date that is humanly readable?
View Replies !
Email Me This Info Page From A Order Confirmation Page?
How do i make a "email me this info" page from a order confirmation page? Basically someone enters some info in a form, then on submission is comes to my email. After submission, i want to have a text area where they can enter an email address to have the info emailed to them if they wish. You can see the page here, you have to enter info first, the email nbox on the second page (process.php) is non fuctional.
View Replies !
How Do You Do No New Posts/new Posts Function
On forums you have the little image at the side. Usually one is faded which means no new posts and the other is the same image but darker which means new posts. How do you go about logging when people have looked in a forum. Surely you can't have a table with an activity time for every forum as this would be imense.
View Replies !
Page Loading Order
Is there a function in PHP that will allow items to load up order? For example, lets say I have three images on a page. Is there anything that can ensure image one fully loads up before going on to image two?
View Replies !
Processing And Page Output Order
I have been using php for some time now and have got the hang of fairly high level processing including dynamic images from mysql output that leads me to the point of needing to better understand the processing /logic order of the php engine so i can increase the speed of my scripts. Code:
View Replies !
Session Of Incomplete Multi Page Order?
In a 2-page order form, not all applicants will complete it due to field validations. If I want to see data from incomplete orders, can this be done using some sort of session control so that each form page data saved (each press on submit will save data to disk) will have a session number attached to it? Thus if the order log contains several line entries from submit attempts, then I can locate the lines that belongs to the same order based on this session ID? Or is there another or more clever way?
View Replies !
Ascending/descending Window Folder Like
i'm trying to make a list of data out of a mysql database order ascending/descending by clicking the name of the column they're under... A bit equal to folders in windows; a click on the name of the folder sorts asc; another click descends. Biggest worry is how to switch between asc and desc all within one script.
View Replies !
Simple Sort Ascending Descending Buttons
I'm trying to find out if its possible to create a button to sort a certain column ascending and descending so you click the arrow pointing down it does descending and up for ascending / / / / / / / / / / | Scan | Manufacturer | Description | Code | Part Number |
View Replies !
IE Displays Php Different Than Mozilla
I have a wierd thing where for some reason internet explorer processes the php differently than mozilla, something i find interesting since i thought that php was run on the server side and the only the result outputted to the browser. I have on my page a top flash banner that i only want it to show its animation every couple of pages rather than every time a user clicks on a link so i threw this code together (probably considered sloppy, i know there is even some redundance that isnt needed but this is the result of rewriting it several possible ways to try to make it work correctly .....
View Replies !
How Php Displays The Output?
If I have a PhP code below in a linux+apache environment, ============================== <?php> the first php block code <?> The HTML code goes here <?php> the second php block code <?> ============================ does php open a temporary file to store the output from "the first php block code"? then combined with "The HTML code goes here" and then the output from "the second php block code"? Then display the output of this temporary file to web client and remove this temporary file afterwards?
View Replies !
PHP/HTML Displays
I am using a PHPed version of an HTML file in order to include an onload function to write to a log file. The problem is that large parts of this file display as garbage 9 times out of 10, and sometimes again with a refresh. Is this a HTML or a PHP problem?(it doesn't occur in my other HTML only pages) If it is a PHP problem, is it a question of delaying script execution until images are displayed? And how do I do that (or whatever else may need doing)?
View Replies !
Calls On A CSV And Displays Every Row
I have a script that calls on a CSV and displays every row. At the moment it seperates each field with a comma. I am struggling with how to seperate each field and put it into a table column. Can someone push me in the right direction. Code:
View Replies !
PHP File Displays
I'm having a strange problem when upgrading the content management system eZ publish from PHP 4.4 to PHP 5.1. Some cache files related to i18n are included with the "include" function, but they are being displayed to the user agent instead of being parsed by PHP. With PHP 4.4 there was no problem.
View Replies !
Sort Displays
I don't know what's wrong with this coding, I get an error Notice: Undefined variable: orderby in F:Htmlfsyc_databasegraduates_list.php on line 11 Notice: Undefined variable: color in F:Htmlfsyc_databasegraduates_list.php on line 30 <? $connection = mysql_connect("localhost","****","********"); $db = mysql_select_db("job_seekers", $connection); $table_name = 'personaldetails' If (isset($sorting)) { $orderby = "ORDER BY $sorting "; If ($sorting == "personaldetails") { $orderby .= "ASC"; } else { $orderby .= "DESC"; } } $sql = mysql_query("SELECT * FROM $table_name $orderby"); ......
View Replies !
Header Sometimes Displays Sometimes Downloads
using Javascript - open a new window: $s=contents of database field in rtf format header("Content-type: text/rtf"); echo $s; This works perfectly in Safari (Mac browser) but in both Netscape and IE5 it tries do download. If I use: header("Content-type: text/rtf"); it downloads in all browsers. I have two questions: 1. How do you know which behavior to expect (download or display) 2. I want to display an RTF file in a browser window. Is there a way to do it that works in IE and Netscape?
View Replies !
Displays A Date From A Database
I have a script running (with great effort and help from the group) that displays a date from a database and the amount of days to that date. I would like to change the date into a more "human" format. The date now displays: 2002-12-08 I would like to change it to: Sunday, December 08th Is this a property of mktime()?
View Replies !
Pear DataObject_FormBuilder Displays Nothing
I'm having problems getting the FormBuilder package to work. I've spent the last 3hrs reading what little documentation and examples I could find and the idea seems great, if only it'll actually display a form. I'm not getting any error message, and I know that my DB_DataObjects are working as I'm able to auto generate the classes and search them. However using the following code which I believe is meant to display a form for the 'users' table, does absolutly nothing except displayed <html><body></body></html>. I did some experimenting to see if there was something wrong with displaying anything, and I found that nothing would print after $builder->getForm() and I have no idea why : CODE: require_once('DB/DataObject.php'); require_once('DB/DataObject/FormBuilder.php'); $config = parse_ini_file('example.ini', true); foreach($config as $class => $values) { $options = &PEAR::getStaticProperty($class, 'options'); $options = $values; } $_DB_DATAOBJECT_FORMBUILDER['CONFIG'] = $config['DB_DataObject_FormBuilder']; $building = DB_DataObject::factory('users'); if (PEAR::isError($building)) { die($building->getMessage()); } $builder = DB_DataObject_FormBuilder::create($building); if (PEAR::isError($builder)) { die($builder->getMessage()); }
View Replies !
Mysql Select Displays Nothing
I'm having some trouble with this script. I have within a table the column "item1name". When I try and run this script everything echos out okay yet the final if statement always displays nothing when there is actually text in the column specified. Any ideas why this is happening? <? $userid="2"; $refslot= "item1"; $ex= "name"; $refiname= $refslot.$ex; echo $refiname; mysql_connect("localhost", "xxx", "xxx") or die(mysql_error()); mysql_select_db("xxx") or die(mysql_error()); $query= mysql_query("SELECT * FROM pcitems WHERE userid='$userid'")or die(mysql_error()); while($row= mysql_fetch_assoc($query)){ $iname= $row['$refiname']; echo "Working"; ................
View Replies !
Multi Column Displays
I'd like to know if there's a good tutorial around that can help me regarding multi-column displays. I'd like to work on photo galleries where the table displays 3 images across, until the last item. Apart from this, I'd like to have some sort of tutorial wherein I can display more columns at a time.
View Replies !
Code Displays In All Browsers
I have installed Apache 2.2.0 and PHP 5 on a Fedora Core 4 box. Both installs finish without an issue but when I check info.php on any browser (have tried IE, Netscape and Firefox) it just displays the code. I have checked the apache error_log and it tells me that PHP is configured, which i thought meant it was ok. Code:
View Replies !
Displays A Word For Two Months Before Changing It
I need a piece of code that displays a word for two months before changing it. So, if we are in September and October the word 'Apple' is displayed and if we are in November and December then the word 'Orange' etc. In all, there are 6 pairs of months, so six words. On the first of the first month, the word changes to the word for that pair of months. I think this might have something to do with arrays but I'm not sure.
View Replies !
Takes The Rating And Displays A Corresponding Image.
I'm making a site where people can make posts which are then rated 1-5. I want to write a php code that takes the rating and displays a corresponding image. I have written this: function ratingImage($overallrating) { if ($overallrating == 0){ echo "<img src="images atingzero.jpg">"; } elseif ($overallrating == 1){ echo "<img src="images atingone.jpg">"; } elseif ($overallrating == 2){ echo "<img src="images atingtwo.jpg">"; } elseif ($overallrating == 3){ echo "<img src="images atingthree.jpg">"; } elseif ($overallrating == 4){ echo "<img src="images atingfour.jpg">"; } elseif ($overallrating == 5){ echo "<img src="images atingfive.jpg">"; }} echo ratingImage($overallrating); This codes works perfectly in safari, but when I view the page in firefox or netscape navigator, the images do not appear. Can anyone think of why this code would not work in these two browsers?
View Replies !
How Can I Track Banner Displays On Another Site.
Hopefully someone can clue me into a solution (coding) to create a banner url that I can post on another site to track the number of times the banner is Displayed on that site. Its pretty straight forward tracking 'clicks' and visitors as the hyperlink can be set up to count track and record visitors easily.. Question is.. what if the do NOT click on the link? I want to know if the banner link I posted is actually being viewed as many times as I am told they are... Same thing would apply to a banner exchange.. How do I know if my banner is being viewed on the other site. Any suggestions on how I can build a link that displays the banners on another site and allows me to record how many times the banner was displayed?
View Replies !
|