Find Jobs
Hire Freelancers

Another quick fix needed

$10-30 USD

In Progress
Posted about 10 years ago

$10-30 USD

Paid on delivery
The PHP Code below is getting information from the database. The database at this point has 7 rows but the file for some reason only gets the last five and does not start at 1. It should display the first 5 lines from the database and then the next two once I click on "Weiter". As there could be a larger number than 7 rows in the database it needs to adjust to it. So if there are 14 lines it would display the 5 newest, than the next 5 and then the oldest 4 etc. Do not bid more than 10 Dollars as this should be an easy fix for someone who knows what they are doing. If you place a bid I assume you have no questions and you are clear with the demands. <?php $result = mysql_query("SELECT UserID,Datum,Headline,Meldung,IconID FROM tippliga_news ORDER BY Datum DESC;"); $treffer = mysql_num_rows($result); echo "<br><br>\n"; if (!isset($start)) { $start = 0; } $anfang = $start+1; $ende = $start+5; if ($treffer<$ende) { $ende=$treffer; } echo "<strong class='innertxt'>News Archiv ...<br>Nachricht $anfang bis $ende von $treffer</strong><br>\n"; $neu = $start - 5; if ($neu >= 0) { echo "<a href=\"[login to view URL]".$neu."\" target=\"_self\">Zur&uuml;ck</a>\n"; if ($start+6 < $treffer) { echo " - "; } } $neu = $start + 5; if ($neu<$treffer) { echo "<a href=\"[login to view URL]".$neu."\" target=\"_self\">Weiter</a>\n"; } echo "<br><br>\n"; for ($i=$start; $i<$start+5; $i++) { $ii = $i; if ($i>=$treffer) { break; } $e1 = mysql_result($result,$ii,"Headline"); $e2 = mysql_result($result,$ii,"Meldung"); $d = mysql_result($result,$ii,"Datum"); $iconid = mysql_result($result,$ii,"IconID"); $icon = mysql_query("SELECT Datei from tippliga_icons Where IconID='$iconid';"); $iconurl = mysql_result($icon,0,"Datei"); $userid = mysql_result($result,$ii,"UserID"); $u = mysql_query("SELECT user from tippliga_user Where UserID='$userid';"); $user = mysql_result($u,0,"user"); $d_neu = strftime("%H:%M:%S - %d.%m.%Y",strtotime($d)); echo "<span class='innertxt'><img src=\"$iconurl\"><b><i> $e1 </b></i> - von $user ($d_neu)</span><br></i>\n"; echo "<span class='innertxt'>$e2</span>\n\n"; if ($i+1 < $start+5) { echo "<br><br>\n"; } } ?>
Project ID: 5770516

About the project

2 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
Seabeck, United States
5.0
420
Payment method verified
Member since Nov 14, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.