Heloo, I have a BIG problem which needs to be solved asap. Hehe 🙂
Here's the problem..I own a gaming review website and need to seperate the review index by System and then into Alphetbical Form. The Systems are placed in wierd in the database, but I dont that could be the problem. Heres what I gave so far below:
<?
$connection = mysql_connect("localhost", "username", "password");
$db = mysql_select_db("database here");
$num = array(0,1,2,3,4,5,6,7,8,9,10);
$alpha = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
print "<p align=\"left\"><a name=\"#num\"></a><font color=\"#696969\" size=\"4\" face=\"Arial\"><b>#</b></font> <br>";
while(list($name,$value)=each($num)) {
$query = mysql_query("SELECT headline,id from article_posts WHERE LEFT(headline,1) = '$value' AND type='review' ORDER BY headline");
while($r=mysql_fetch_row($query)) {
print "<a href=\"http://myurl/reviews/review.php3?review_id=$r[1]\"><font size=\"2\" face=\"verdana,arial,helvetica,monaco\">$r[0]</font></a> <BR>";
}
}
while(list($name,$value)=each($alpha)) {
$query = mysql_query("SELECT headline,id from article_posts WHERE LEFT(headline,1) = '$value' AND type='review' ORDER BY headline");
print "<p align=\"left\"><a name=\"".strtolower($value)."\"></a><font color=\"#696969\" size=\"4\" face=\"Arial\"><b>$value</b></font> <br>";
while($r=mysql_fetch_row($query)) {
print "<a href=\"http://myurl/reviews/review.php3?review_id=$r[1]\"><font size=\"2\" face=\"verdana,arial,helvetica,monaco\">$r[0]</font></a> <BR>";
}
}
mysql_close($connection);
?>
<center>
I have no clue on how to organize it by systems, but the systems table is somewhere below. I copied a peice of a page where the review would display on where it would say what system the game is on..
$query = mysql_query("SELECT *,dev_name,pub_name,UNIX_TIMESTAMP(date_stamp) as UnixTime,f_name,l_name FROM article_posts,article_dev,article_pub,article_staff_profiles WHERE article_posts.id='$preview_id' AND article_posts.dev_id=article_dev.id AND article_posts.type='preview' AND article_posts.pub_id=article_pub.id AND article_posts.staff_id=article_staff_profiles.id");
$r = mysql_fetch_array($query);
$headline = $r["headline"];
$date_stamp = $r["UnixTime"];
$staff_name = $r["f_name"]." ". $r["l_name"];
$pub = $r["pub_name"];
$dev = $r["dev_name"];
$story = explode("||",$r["full_story"]);
$system = $story[0];
Now how would I organize the index by systems then healine in alphetibcal form? The systems are PS2, Psone..??