Test:Test

From OOUG
Revision as of 20:04, 20 November 2012 by Ooug7589 (talk | contribs)
Jump to navigation Jump to search

This is for testing <?php | $con = mysql_connect("localhost","root","Sert1!@#"); |

                                                                               |

if (!$con) |

 {                                                                             |
   die('Could not connect: ' . mysql_error());                                 |
 }                                                                             |
                                                                               |

mysql_select_db("pokedex", $con); |

                                                                               |

setlocale(LC_ALL, 'ja_JP.UTF-8'); |

                                                                               |

$result = mysql_query("SELECT * FROM kanto order by number"); |

                                                                               |
                                                                               |

$i = 0; | $offset = 330; |

                                                                               |

print "

\n"; print "";
                                                                               |

$sort = $_GET["sort"]; |

                                                                               |

if ($sort=="1") |

 $result = mysql_query("SELECT * FROM kanto order by hex");                    |
                                                                               |

else if ($sort=="2") |

 $result = Mysql_query("SELECT * FROM kanto order by engName");                |
                                                                               |
                                                                               |

while($row = mysql_fetch_array($result)) |

 {                                                                             |
   $get = $i + 1;                                                              |
                                                                               |
   if ($i % 9 == 0 && $i != 0)                                                 |
     {                                                                         |
print "
Pokédex NumberHex ValueSpriteName

"; |

                                                                               |
       if ($offset % 660 == 0 && $offset != 0)                                 |
         {                                                                     |

print "

\n"; $offset = 0; | } | | else | { | print "
\n"; $offset = $offset + 330; | } | | print "";
     }                                                                         |
                                                                               |
print "\n"; | | print ""; |
                                                                               |
print ""; |
                                                                               |
print " ";
                                                                               |
print "\n";
                                                                               |
print "\n"; | | | /* echo $row['number'] . " " . $row['engName']; | echo "
"; | */ | $i++; | } | | print "
Pokédex NumberHex ValueSpriteName
".$row['number'] ."" . $row['hex'] . "<img src=\"pics/" . $row['engName'] . ".png\" height=50 width=50 /><a href=\"getPokemonSQL.php?zukan=" . $row['number'] . "\" >" . $row['engName'] . "</a>

\n"; |

                                                                               |

mysql_close($con); | ?>