Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Viewing records of a database usings tables
Old 07-05-2005, 08:37 PM Viewing records of a database usings tables
Novice Talker

Posts: 7
Trades: 0
I know how to obtain an array of the records, but I want to view the records one at a time through textboxes from a table. I want to be able to press a button and move from one record to another. Also I want to be able to press a button to go to the first or last record. Is this possible and does PHP_SELF has anything to do with it?
rhinton6 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-05-2005, 10:51 PM
Novice Talker

Posts: 7
Trades: 0
This is the code I have so far:

<html>
<BODY BGCOLOR=#3399CC>
<head>
<title>CHS Master Inventory System</title>
</head>
<B><FONT SIZE=10><CENTER>CHS Master Inventory</CENTER></FONT SIZE></B>
<h1><i><u><center>UPS Table</center></u></i></h1>
<table>
<tr>
<th>Room/Area:</th><br>
<th>CHS ID:</th><br>
<th>Model:</th><br>
<th>Serial:</th><br>
<th>Manufacturer:</th>
</tr>
<?php
/* set's the variables for MySQL connection */
$dbhost = "localhost:3306"; // this is the server address and port
$dbuname = "root";// username
$dbpass = "hoover"; // password
$dbname = "chs";

/* Connects to the MySQL server */
$dbase = mysql_connect($dbhost, $dbuname, $dbpass);

/* Defines the Active Database for the Connection */
mysql_select_db($dbname, $dbase);

$sql = "SELECT * FROM ups";
$result = mysql_query($sql, $dbase) or die (mysql_error());

for ($i=0; $i<$result->numRows(); $i++) {
$array = $result->fetchRow(DB_FETCHMODE_ASSOC,$i);

?>
<tr>
<td><?php echo $array ['RmArea']; ?></td>
<td><?php echo $array ['ChsID']; ?></td>
<td><?php echo $array ['Model']; ?></td>
<td><?php echo $array ['Serial']; ?></td>
<td><?php echo $array ['Manuf']; ?></td>
</tr>
<?php
} // end: for
mysql_close($dbase);
?>
</table>
</body>
</html>
rhinton6 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Viewing records of a database usings tables
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10295 seconds with 12 queries