cherry-pie
Hi I'm having some problems with mysql & php connection, it was working last week but now it's not working anymore and I don't know what is the problem
it was to show the layouts of each category separately but is showing all mixed together and some do not appear
Here is the page:
http://animetemplates.110mb.com/index.php?page=animetemplates&category=CardCaptorSakura
http://animetemplates.110mb.com/index.php?page=animetemplates&category=Air
this is the code
If someone knows what is happening I would be sooo greatful
ps: i'm not used to mysql language so don't be mad at me xD
ps2: my english is really bad i hope you can understand me
Here is the page:
http://animetemplates.110mb.com/index.php?page=animetemplates&category=CardCaptorSakura
http://animetemplates.110mb.com/index.php?page=animetemplates&category=Air
this is the code
| Quote: |
|
<?php include ('dbconfig.php'); $table = 'layouts'; // The name of your table in the database $limit = '5'; // How many results should be shown at a time $scroll = '20'; // How many elements to the navigation bar are shown at a time // Get the total number of rows in a database $query1 = mysql_query ("SELECT id FROM $table WHERE category='$category'"); $numrows = mysql_num_rows ($query1); // if (!isset ($_GET[show])) { $display = 1; } else { $display = $_GET[show]; } // Return results from START to LIMIT $start = (($display * $limit) - $limit); if(isset($category)){ $query = "select * from $table where category='$category' order by id desc limit $start, $limit"; }else{ $query = "select * from $table order by id desc limit $start, $limit"; } $result= mysql_query($query, $connection) or die ("Could not execute query : $query." . mysql_error()); // Continue usual Code, display data while ($row=mysql_fetch_array($result)) { extract($row); echo "<table border=\"0\" bordercolor=\"#000000\" cellpadding=\"0\" cellspacing=\"0\" width=\"163\" align=\"center\"><tr><td width=\"163\"> <p align=\"center\"><img src=\"$previewimage\"></td> </tR> <tr> <td width=\"163\"><b>Nome:</b> $name<br> <b>Data:</b>$date<br> <b>Template by:</b> <a href=\"$artisturl\">$artist</a><br> <b>Disponível:</b> $series<br> <A href=\"$viewhtml\" target=\"_blank\">Pegar Código</a> | <a href=\"$download\">Download</a></td> </tr> </table><br>"; } $paging = ceil ($numrows / $limit); // Making the next prev links if ($display > 1) { $previous = $display - 1; echo "<a href=\"$_SERVER[PHP_SELF]?page=animetemplates&category=$category&show=$previous\" target=\"_self\"><<Previous</a> | "; } if ($numrows != $limit) { if ($paging > $scroll) { $first = $_GET[show]; $last = ($scroll - 1) + $_GET[show]; } else { $first = 1; $last = $paging; } if ($last > $paging ) { $first = $paging - ($scroll - 1); $last = $paging; } for ($i = $first;$i <= $last;$i++){ if ($display == $i) { echo "<b>$i</b> "; } else { echo "<a href=\"$_SERVER[PHP_SELF]?page=animetemplates&category=$category&show=$i\" target=\"_self\">$i</a> "; } } } if ($display < $paging) { $next = $display + 1; echo "| <a href=\"$_SERVER[PHP_SELF]?page=animetemplates&category=$category&show=$next\" target=\"_self\">Next>></a> "; } // ?> |
If someone knows what is happening I would be sooo greatful
ps: i'm not used to mysql language so don't be mad at me xD
ps2: my english is really bad i hope you can understand me
