So I'm making a feedback sort of section on a website with MySQL and PHP, I've gotten the script to do everything I want except for this. I want the script to only show 5 at a time (which i have accomplished no problem), but I'm also trying to make it so that when the user clicks a button it will show the next 5 records in the database so they can view all records, but only 5 at a time. (I hope this makes sense). So I need the button to add 5 to my $start variable, and then re-run my for loop.
$start = 0;
echo $start . "<br /><br />";
$result2 = mysql_query("SELECT * FROM testtable LIMIT $start,5") or die(mysql_error());
$row2 = mysql_fetch_array($result2);
for($counter = 1; $counter <= 5; $counter += 1)
{
echo $row2['ID'] . "<br />";
echo " Subject:<b><font color='red'> " . $row2['Subject'] . "</font></b>";
echo "<br />Message: <b>" . $row2['Message'] . "</b><br /><br />";
$row2 = mysql_fetch_array($result2);
}
mysql_close($con)
?>
<br />
<form>
<input type="button" value="submit" onclick="<?php $start += 5; ?>" />
</form>
<?php echo $start; ?>
Any help would be greatly appreciated!
Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the code for several hours now, making small adjustments here and there to try to fix this problem.
Retreiving objects from Sessions
Hi all,I am getting really frustrated with storing and retreiving objects from a session. But it may be because of my lack of knowledge in sessions First some system specs:OS - Vista Home
displaying email without attracting a ton of spam
Hello,this is maybe the wrong place to ask.How would you display an email address on a website without attraciting all the spammers of the world to fill your mailbox ?does anybody use something
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well. The "$msgVar" goes into the body message of the email. How can I effect additional fields that can be
AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called through onClick="function ..." on the submit button. That all works perfectly, however the
cURL proxy
Okay here is the thing... i know how to add proxysCode: curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);curl_setopt($ch, CURLOPT_PROXY,"[i][b]PROXYHERE[/b][/i]");Here are my questions..
Need help with some php code :)
Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =DI'm trying to learn PHP and MySQL, and atm I am trying to make a website which corresponds with a database - a
FTP Programs
Here is a list of commonly suggested FTP Programs to use:FileZillaSmartFTPCuteFTPRightFTPCoreFTPJFTPFireFTP
Header redirect
Hello ive got a problem ive got form with its action set to itself.Code: <form id="formID" class="formular" method="post" action=""/>it then runs