Jump to content

[SOLVED] MYSQL PHP adding "next page" in current PHP code


$username

Recommended Posts

Hello Guys,

    I have a feeling that this is a bigger project then I think it maybe.

I have a MYSQL data being pulled in by PHP I have the code to do this but I do not have the code to make it work with next pages.

    I did find some code that looks like I could get the next pages to work. But i was going to see if you guys have a easy, better way to get it to work with the code I have.

 

<?php

if (isset($_COOKIE["user"]))

setcookie("user", ($_COOKIE["user"]), time()+600);


else
header("Location:cookerr.htm");
$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<script type="text/javascript"> 
function confirmdelete() { 
return confirm("Are you sure you want to delete?");   
} 
</script> 

<?php
include 'dbopen.php';
include 'dbconnect.php';


if(!isset($cmd)) {
?>
<?php
if (!isset($_POST['submit'])) {
?>
<link href="/midaps/admin/tools/css/admin_style.css" rel="stylesheet" type="text/css" />


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> --- </title>
<style type="text/css">
<!--
body {
background-color: #ffffff;
background-image: url(../images/bg.png);
}

table, tr, td, div{



font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#000000;
border-collapse: collapse;
}
A:link { color: #000000; text-decoration : none;}
A:visited { color: #000000; text-decoration : none;}
A:active { color: #000000; text-decoration: none;}
A:hover { color: red; text-decoration: none;font-weight:bold;}

.style3 {
font-size: 14px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style10 {font-size: 10; font-weight: bold; }
-->
</style></head>

  <div>
<table>
   <tr>
<td>
	<form action="show.php">  
  <input name="submit3" type="submit" value="Show Cases" /></td>
	</form>
<td>	<form action="write.php">  
  <input name="submit32" type="submit" value="Add New Case" /> </td>
	</form>
<td>	<form action="lobby.php">  
      <input name="submit33" type="submit" value="Main Page" /></td>
	</form>
<td>	<form action="logoff.php">
  <input name="submit2" type="submit" value="Log Off" /></td>
	</form>
</td>
  </tr>
</table>
  </div>
</form>


<col span="1" align="right">
<!--
<p>
<form method="POST" action="updateinfo.php">
<table>
<col span="1" align="right" row span="2">
<tr>
	<td><font color="black">Case ID to Update:</font></td>
	<td><input type="text" name="ID" ></td>

	<td><input type="submit" value="Submit"></td>

</tr>
<tr>
>-->
<!-- <img width="400" height="100" src="\testmidapslogo.jpg"> -->
</tr>
</table>
</form>
</p>
<p>
<form action="delete.php" onsubmit="return confirmdelete();">
Case ID to Delete: <input type="text" name="IDname">
<input type="submit" name="delete" value="Delete">
</form>
</p>

<?
} else {
$ID = $_POST['IDname'];

$query=("DELETE FROM store WHERE ID = '$ID'");
mysql_query($query)
or die(mysql_error());
echo "";

}
}
?>

<p>
</p>
</tr>
</table>
</form>
</p>
<table border="2" width="1800" rules="all" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="silver">
  <tr>
    <td><a href="./show.php?Ord=ID"><b><u>Case ID</u></b></td>
    <td><a href="./show.php?Ord=FirstName"><b><u>First Name</u></b></td>
    <td><a href="./show.php?Ord=LastName"><b><u>Last Name</u></b></td>
<td><a href="./show.php?Ord=AddressStreet"><b><u>Street</u></b></td>
<td><a href="./show.php?Ord=AddressCity"><b><u>City</u></b></td>
<td><a href="./show.php?Ord=AddressState"><b><u>State</u></b></td>
<td><a href="./show.php?Ord=AddressZip"><b><u>ZipCode</u></b></td>
<td><a href="./show.php?Ord=Paid"><b><u>Paid</u></b></td>
<td><b>Amount</b></td>
<td width="200"><b>Attempt 1</b></td>
<td><b>Attempt 2</b></td>
<td><b>Attempt 3</b></td>
<td><b>Attempt 4</b></td>
<td><b><a href="./show.php?Ord=OtherInfo"><u>Other Info</u></b></td>
<td><b><a href="./show.php?Ord=ServBy"><u>Served By</u></b></td>
<td><a href="./show.php?Ord=ClientName"><b><u>Client Name</u></b></td>
<td><a href="./show.php?Ord=County"><b><u>County Served</u></b></td>
<td><b>Serv Date</b></td>
  </tr>

<?php
$Ord = $_GET['Ord'];
if ($Ord == "") 
$Ord = 'ID';
else
$Ord = $_GET['Ord'];
$sql = "SELECT * FROM store ORDER BY `$Ord` DESC LIMIT 0,250"; 
$query = mysql_query($sql);


while($row = mysql_fetch_array($query)) {
echo "<tr>";
echo("<td><a href=\"updateinfo.php?ID=" .  $row["ID"] . "\" title=\"".$row["ID"]."\">" . $row["ID"] .  "</a></td>"); 
//echo "<td>".$row['ID']."</td>";
echo "<td>".$row['FirstName']."</td>";
echo "<td>".$row['LastName']."</td>";
echo "<td>".$row['AddressStreet']."</td>";
echo "<td>".$row['AddressCity']."</td>";
echo "<td>".$row['AddressState']."</td>";
echo "<td>".$row['AddressZip']."</td>";
echo "<td>".$row['Paid']."</td>";
echo "<td>".$row['Amount']."</td>";
echo "<td>".$row['CaseNotes1']."</td>";
echo "<td>".$row['CaseNotes2']."</td>";
echo "<td>".$row['CaseNotes3']."</td>";
echo "<td>".$row['CaseNotes4']."</td>";
echo "<td>".$row['OtherInfo']."</td>";
echo "<td>".$row['ServBy']."</td>";
echo "<td>".$row['ClientName']."</td>";
echo "<td>".$row['County']."</td>";
echo "<td>".$row['ServDate']."</td>";
echo "</tr>";
}

?>
</table>
</body>
</html>

 

If this is to much to ask just let me know, and I will work on it and post the code that I have issues.

 

Thank you,

Brett

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.