Hello,
I have designed a web site for a friends haunted forest. He is wanting a comment/feedback thread where people can come and tell about their experience. The thread works great, but the problem I am having now is I need it to either scroll or only show 4-5 comments at a time then give you a next button to click to get to the next set of comments. Here is what all the code looks like. It is in 3 sections, the feedback display, the php code, and the newfeedback form where you would write your feedback. [code]
$server = ‘mysql.freehostingnoads.net’;
$user = ‘u197478342_story’;
$pwd = ‘rabbit88’;
$db =‘u197478342_hauntfor’;
$DB->Connect($server, $user, $pwd, $db);
$DB->SetFetchMode(ADODB_FETCH_NUM);
$rs = $DB->Execute(“SELECT * FROM survivorStories”);
while ($rs->EOF == FALSE){
for ($i=0; $i < sizeof($rs->fields); $i++)
{
switch($i){
case 0:
$Name = $rs->fields[$i];
break;
case 1:
$Date = $rs->fields[$i];
break;
case 2:
$Story = $rs->fields[$i];
break;
}
}
echo ‘
Name: ‘.$Name.’ | ’;Date: ‘.$Date.’ | ’;
Story: ‘.$Story.’ | ’;
echo ‘
’;
$rs->MoveNext();
}
?>
Click To Tell Us Your Story
<div id="footer">
<p><a href="http://flashbangpro.com" target="_blank">Copyright © 2011 FlashBang Productions</a></p>
</div>
</div>
</body>
[/code]
[php]<?php
include(‘adodb/adodb.inc.php’);
$DB = NewADOConnection(‘mysql’);
$server = ‘mysql.freehostingnoads.net’;
$user = ‘u197478342_story’;
$pwd = ‘rabbit88’;
$db =‘u197478342_hauntfor’;
$DB->Connect($server, $user, $pwd, $db);
$DB->SetFetchMode(ADODB_FETCH_NUM);
$Name = $_POST[‘name’];
$Date = $_POST[‘date’];
$Story = $_POST[‘story’];
mysql_query("INSERT INTO survivorStories
(Name, Date, Story) VALUES(’$Name’, ‘$Date’, ‘$Story’) ");
header (‘location: blog.php’);
exit();
?>
[/php]
[code]
Surviver Tales a:link {color:#FFFF00;} /* unvisited link */ a:visited {color:#FFFF00;} /* visited link */ a:hover {color:#FFFF00;} /* mouse over link */ a:active {color:#FFFF00;} /* selected link * </div>
<div id="footer">
<p><a href="http://flashbangpro.com" target="_blank">Copyright © 2011 FlashBang Productions</a></p>
</div>
</div>
</body>
[/code]
I am new to PHP and trying to teach myself as much as I can.
Thank You all in advance for your help.