PDA

View Full Version : Flash Blog Issues


KamoJeff
01-25-2008, 09:18 PM
Hello everyone,

I'm just starting to get back into programming again, and I decided to reintroduce myself to the basics using this tutorial (http://www.webmonkey.com/webmonkey/03/40/index0a.html?tw=programming) for making a Flash/PHP/MySQL based blog. Unfortunately, I'm having trouble with how Flash displays the information found in the Database - that is to say, it will only show the information found under "Entries" without displaying the Titles, Dates or Archive menu.

The following is the coding I've been using:

ActionScript 1.0

function lv(l, n, t, e, f) {
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
n.htmlText = "";
if (t == undefined) {
n.htmlText += "<b>"+this["title"+e]+" - "+this["date"+e]+"</b><br><br>";
n.htmlText += this["entry"+e];
} else {
for (i=o; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+" - "+this["date"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);
}
function loadArc(passed) {
arcNum = passed-1;
lv(undefined, entries_txt, undefined, arcNum, "blog/blog.php");
}
//for the large entry textfield
lv(undefined, entries_txt, undefined, 0, "blog/blog.php");
//for the archives text field
lv(undefined, archive_txt, "cycle", null, "blog/blog.php");


<?php
mysql_pconnect ("localhost", "root", "");

mysql_select_db ("gameblog_db");

$qResult = mysql_query ("SELECT * FROM blog_entries ORDER BY id DESC");
$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;


for ($i=0; $i < $nRows; $i++){
$row = mysql_fetch_array($qResult);
$rString ="&id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&"."&date".$i."=".$row['date']."&"."&entry".$i."=".$row['entry']."&";
}
echo $rString."&";

?>

The information found in my database should be something like...
id: 1
date: 2008-01-24 01:12:35
title: my first blog entry
entry: some text

However, when all is said and done, the flash blog ends up looking like this:
http://img.photobucket.com/albums/v318/Toshiki/flashblog.jpg

Now I've tried fiddling around with this all night last night, but to no avail. If anyone could help, I highly appreciate it! Thanks in advance!