Ok thanks, so I need unique links, I need help looping through my counties and from then to the pubs in that county ... Please help?! X
Sent from my iPhone On 17 Jan 2011, at 20:20, Mogens Beltoft <[email protected]> wrote: > Have you tried "View Page Source"? > > - You have a blank entry at the top. > - Something goes bad in SQL at the end of the file. > - Your four character hrefs are not unique - look at all the "#Coun" entries. > - Your second <ul> is Aberdeenshire, there are not other areas in the list, > that's why the other links don't work. > - That's not entirely true, London also works and displays the error I > mentioned earlier. > > Hope that helps. > > /Mogens > > On 17-01-2011 17:38, [email protected] wrote: >> hi, at the moment, my page only works with the County: Aberdeenshire >> >> http://www.mypubspace.com/iphone/pubs >> >> user: test >> pass: test >> >> List of Counties County List >> >> Aberdeenshire County List >> >> >> The code for my Pubs page is below..., >> >> I think I need to change the hard coded bit that reads: >> Code: >> [code] >> echo "<ul title=\"Pubs in Angus\" id=\"Angu\">"; >> [/code] >> >> and the SQL string: >> Code: >> [code] >> $query = "SELECT * FROM pubs WHERE rsCounty = 'Angus' LIMIT $offset, >> $rowsPerPage"; >> [/code] >> >> pubs page >> >> [code] >> <?php >> include_once("config.php"); >> include_once("functions.php"); >> // Check user logged in already: >> checkLoggedIn("no"); >> //doCSS(); ?> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// >> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >> <html xmlns="http://www.w3.org/1999/xhtml"> >> <head> >> <meta http-equiv="Content-Type" content="text/html; >> charset=iso-8859-1" /> >> <title>My Pub Space</title> >> <link rel="stylesheet" type="text/css" href="stylesheets/style1.css" >> title="default" /> >> <meta name="viewport" content="width=device-width; initial-scale=1.0; >> minimum-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> >> <link rel="apple-touch-icon" href="../iui/iui/mps-icon.png" /> >> <style type="text/css" media="screen">@import "../iui/iui/iui.css";</ >> style> >> <script type="application/x-javascript" src="../iui/iui/iui.js"></ >> script> >> <meta name="apple-touch-fullscreen" content="YES" /> >> <script type="text/javascript" src="js/jva.js"></script> >> >> </head> >> >> <body> >> <? >> $offset = (isset($_GET['start'])) ? (int)$_GET["start"] : 0; >> $rowsPerPage = (isset($_GET['count'])) ? (int)$_GET["count"] : 10; >> $query = "SELECT * FROM pubs WHERE rsCounty = 'Angus' LIMIT $offset, >> $rowsPerPage"; >> $result = mysql_query($query) or die(mysql_error().'<br>SQL: ' . >> $query); >> >> >> //looping counties >> $query1 = "SELECT rsCounty, COUNT(PUBID) AS County_Count FROM pubs >> GROUP BY rsCounty"; >> $result1 = mysql_query($query1) or die(mysql_error().'<br>SQL: ' . >> $query1); >> $County1 = $result1['rsCounty']; >> $CountyCount = $result1['County_Count']; >> ?> >> <div class="toolbar"> >> <h1 id="pageTitle">Select County</h1> >> <a id="backButton" class="button" href="#"></a> >> <a class="button" href="logout.php" target="_self">Logout</a> >> </div> >> <ul title="Select County" id="county" selected="true"> >> <?php >> while ($row = mysql_fetch_assoc($result1)){ >> $RSCOUNTY1 = $row['rsCounty']; >> $RSCOUNTY1short = substr($row['rsCounty'],0,4); >> $CountyCount = $row['County_Count']; >> echo<<<EOF >> <li><a href="#$RSCOUNTY1" class="digg-count">$CountyCount</a> >> <a href="#$RSCOUNTY1short">$RSCOUNTY1</a></li> >> EOF; >> } >> echo "</ul>"; >> >> // start East Sussex >> echo "<ul title=\"Pubs in Angus\" id=\"Angu\">"; >> while($row = mysql_fetch_array($result)){ >> $PUBID = $row['PUBID']; >> $rsPubName = $row['rsPubName']; >> $rsAddress = $row['rsAddress']; >> $rsPostCode = $row['rsPostCode']; >> $rsTel = $row['rsTel']; >> $rsTown = $row['rsTown']; >> $rsCounty = $row['rsCounty']; >> // how many rows we have in database >> // print the link to access each page >> >> $self = $_SERVER['PHP_SELF']; >> $next = "<li><a href=\"all.php?start=" . ($offset + $rowsPerPage) . >> "&count={$rowsPerPage}\" target=\"_replace\">View More</a></li>"; >> //div container of header and information >> echo<<<EOF >> <li><a href="viewpub.php?PUBID=$PUBID">$rsPubName</a></li> >> EOF; >> if ($_SESSION["RSUSER"] == "admin") >> { >> echo "<a href=\"edit.php?PUBID=$PUBID\" class=\"small\">edit this pub</ >> a>"; >> } >> } >> echo $next; >> echo "</ul>"; >> // End East Sussex >> >> >> ?> >> </body> >> </html> >> [/code] >> > > > -- > You received this message because you are subscribed to the Google Groups > "iPhoneWebDev" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/iphonewebdev?hl=en. > -- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
