PDA

View Full Version : Ok I am learning, but...


10-14-2000, 03:54 PM
Ok I am almost there

I am working with code that I think started as Evas active topics and changing it for another purpose.

I have created a hidden forum and it will be available for use by one person.

Then using the following code to throw the data from that forum out on a page on the actuall web site - this is sort of what it will look like, sort of, when finished

http://tuffsports.com/NBA/TheWayItis.php3

ok the code


<?php
require("admin/config.php3");

$num_active = 5;
$num_chars = 9999999;

$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$querylatest="select * from thread where forumid='20' order by lastpost desc limit
$num_active";

$resultlatest = mysql_query($querylatest,$db);

print("<center><table width=\"100%%\" cellspacing=\"0\" cellpadding=\"2\">");

while ($latest_array = mysql_fetch_array($resultlatest)) {

// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);

printf("<br><br><center><b><font color=\"#000080\" size=\"4\" face=\"Verdana, Arial, Helvetica,
sans-serif\">%s</font></b></center><br>",$latest_array["title"]);

// split the date up a bit
$datestr1 = substr($latest_array["dateline"],0,10);
$datetime = substr($latest_array["dateline"],11,8);
printf ("<font face=\"Verdana, Arial, Helvetica, sans-serif\"
size=\"1\"><b>%s</b><br></font>", $datetime);

$querythread="select * from post where threadid='$latest_array[threadid]' order by
dateline asc limit 1";

$result_thread_text= mysql_query($querythread,$db);

$result_thread_array = mysql_fetch_array($result_thread_text);
printf ("%s",$result_thread_array["pagetext"]);
?>

(so it looks ugly - I am still working with it, or its working me over - one of the two)

Ok the problem is, and you can see it if you go the web page and look at the bottom is getting a parse error in line 42 or something like that - its the very last line

?>

I have no spaces anywhere or anything like that, I have checked. I am lost. Everything works like a charm except the ugly parse error at the very end.


my main page will be http://tuffsports.com/basketballmainpage.php3 and am still doing a little work on that (thanks all for the help on questions and code to make that work)

One other question - if you look at the mainpage on the right you will see a box with articles and updates - the next thing I am going to do is attempt to work on code to have that automaticaly spit out. How would I have it call off the title of a post from selected forums, then link to that post not at vbulletin, but link to it on the actual web page? Just wondering what a snippet of code would have to look like, I want to do it but I havnt programmed since Visual Basic first came out. I figure it would be some if else statements, but not sure, and not sure what they would have to look like.


Ok thanks again for the previous help and *hopefully* future help. Dont worry I am picking this up quick and already have a couple of hacks in the thought process, and should have enough knowledge within a month to start working on them.

10-15-2000, 12:05 AM
You forgot to close your while loop.