Current location: Hot Scripts Forums » Other Discussions » Database » Navigation?


Navigation?

Reply
  #1 (permalink)  
Old 07-02-09, 06:37 AM
zenix zenix is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
Navigation?

Hello, I am making some progress on this database I am building for practice...I am new to programming...and was wondering if there is any way to add navigation functionality using buttons or links under the fields being displayed to go to the next or previous record.

I Also am trying to figure out how to display the table information in editable fields on a form so updating it can be more simple, trying to learn that one on my own, but if anyone has any advice i would certainly appreciate it.

Thank you in advance! This is an awesome forum!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-10-09, 09:37 AM
soloWebDev soloWebDev is offline
Wannabe Coder
 
Join Date: Apr 2007
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
I googled: php mysql next previous
php mysql next previous - Google Search
the first link is good and should give you a good direction.

the second part would be done by having something like this.
PHP Code:

<?php
//connect to db
include("connection.php");
if(
$update == 'Update'){
    
$upd "UPDATE table SET name = '".$name."', fColor = '".$fColor."' WHERE x = '".$yID."'";
    
mysql_query($upd);
    unset(
$upd)
    
$desLoc 'thankYou.php';
    
header('Location: '.$desLoc);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>demo</title>
</head>

<body>
<?php
    $sql 
"SELECT yID, name, fColor FROM table WHERE x = '".$y."'";
    
$res mysql_query($sql);
    
$row mysql_fetch_row($res);
    
$yID $row[0];
    
$name $row[1];
    
$favColor $row[2];
?>
<table width="500">
<form name="f1" action="" method="post">
<input type="hidden" name="yID" value="<?=$yID?>" />
    <tr>
        <td colspan="2">Form</td>
    </tr>
    <tr>
        <td>Name</td>
        <td><input type="text" name="name" value="<?=$name?>" />
    </tr>
    <tr>
        <td>Fav Color</td>
        <td><input type="text" name="fColor" value="<?=$favColor?>" /></td>
    </tr>
    <tr>
        <td colspan="2"><input type="submit" name="update" value="Update" /></td>
    </tr>
</form>
</table>
</body>
</html>
__________________
We will see what happens next.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Map a Hard Drive for Navigation on CD assyrian47 The Lounge 0 09-28-06 10:31 AM
Magical appearing navigation kjmatthews CSS 3 04-01-06 02:38 PM
Navigation Menu mic_scp JavaScript 4 03-08-05 05:46 AM
Xml Driven flash navigation arbel Script Requests 0 12-14-03 01:50 PM


All times are GMT -5. The time now is 08:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.