Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-09-2005, 12:54 PM
New kid on the block
 
Join Date: Aug 2005
Location: Penang
Posts: 5
Rep Power: 0
sangasura is on a distinguished road
display database mysql

kenapa lps saya login, nak view data dari database tak kluar?
nak view tu saya just guna aplikasi dalam dreamweaver.

ni coding login saya
PHP Code:
<?php
include 'conf.php';

if(
$_POST)

    
$_SESSION['user'] = send_login($_POST['ICNo'],$_POST['Password']);
    if(!empty(
$_SESSION['user']['ICNo']))
    {
        
$_SESSION['user']['auth'] = True;
        
header("Location: Index2.php");//sekiranya ICNo = Password
    
}
    else
    {
        
header("Location: LoginFail.php");//sekiranya password n ic no sama sama
    
}
}

function 
send_login($ICNo,$Password)
{
    
$qid mysql_query("select ICNo from dbStudent where ICNo='$ICNo' and Password='$Password'");
    
$data mysql_fetch_array($qid);

    if(!empty(
$data))
    {
        return 
$data;
    }
    else
    {
        return 
false;
    }
}
//pres($_SESSION);
?>
dalam index2.php ada menu view my account.
bila click link ni akan paparkan data yg ada bagi user tersebut dalam dbase.
ni antara coding nak paparkan data dalam page myaccount.php
PHP Code:
<?php require_once('Connections/Con1.php'); ?>
<?php
$colname_MyAccount 
"1";
if (isset(
$_GET['ICNo'])) {
  
$colname_MyAccount = (get_magic_quotes_gpc()) ? $_GET['ICNo'] : addslashes($_GET['ICNo']);
}
mysql_select_db($database_Con1$Con1);
$query_MyAccount sprintf("SELECT * FROM dbstudent WHERE ICNo = '%s'"$colname_MyAccount);
$MyAccount mysql_query($query_MyAccount$Con1) or die(mysql_error());
$row_MyAccount mysql_fetch_assoc($MyAccount);
$totalRows_MyAccount mysql_num_rows($MyAccount);
?>
PHP Code:
      <th scope="row"><div align="left" class="style2">Name</div></th>
      <td colspan="6"><?php echo $row_MyAccount['Name']; ?>      </td>
masalah skrg knapa tak papar data?
someone tolong saya..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-09-2005, 02:35 PM
putera-'s Avatar
Novice Webmaster
 
Join Date: Nov 2003
Location: dEpAn PŠ
Posts: 13
Rep Power: 0
putera- is on a distinguished road
Send a message via ICQ to putera- Send a message via Yahoo to putera-
mysql_fetch_assoc boleh tukar kepada mysql_fetch_row
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 19-09-2005, 03:45 PM
heterozigot's Avatar
Novice Webmaster
 
Join Date: Jan 2003
Location: PJ
Posts: 51
Rep Power: 73
heterozigot is on a distinguished road
Send a message via ICQ to heterozigot Send a message via Yahoo to heterozigot
Putera, kegunaan sebenar mysql_fetch

mysql_fetch_assoc = $row['Name'] .... sahaja
mysql_fetch_row = $row[0] atau $row[1] atau $row[2] ....sahaja
mysql_fetch_array = $row[0] atau $row[1] atau $row[2] .... atau $row['Name']....
__________________
Try and Support Malaysia Product.
http://foto.home.net.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
display data,camne??? adib Website Programming 14 21-08-2004 10:27 AM
display value listbox nov8998 Website Programming 1 25-06-2004 02:21 PM
nak display xml gune html bleh ke? bloodymary Website Design 9 24-11-2003 02:42 PM
Display contents mysticmind Website Design 3 04-05-2003 08:55 PM
mail () display all html codes joyce Website Programming 8 23-09-2002 04:36 PM


All times are GMT +8. The time now is 01:12 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61