มีปัญหาเรื่อง ระบบสมาชิกครับ ช่วยดูให้ที

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: มีปัญหาเรื่อง ระบบสมาชิกครับ ช่วยดูให้ที

Re: มีปัญหาเรื่อง ระบบสมาชิกครับ ช่วยดูให้ที

โดย mindphp » 05/02/2011 11:37 am

มันแจ้งว่า ในตาราง users ไม่มี field ชื่อ username
ลองเช็ตรายละเอียดตารางดูครับ

มีปัญหาเรื่อง ระบบสมาชิกครับ ช่วยดูให้ที

โดย ฝึกหัดเขียน » 04/02/2011 8:51 am

ผมใช้ dream เขียนะครับ ปรับมาจากหนังสือ พอรันจะขึ้นว่า Unknown column 'users.username' in 'field list' และตรงนี้ <?php include("header.php");?> พอลบออก มานจะแสดง ฟอร์มที่ผมวางไว้อะแต่ถ้าไม่ลบ จะมีแค่หัวเว็บกับเออเรอ
ถ้าตามที่คิดไว้ พอรันเสร็จ ระบบจะแสดง ข้อความต้อนรับ ประมาณว่า
คุณได้สมัครสมาชิกเรียบร้อยแล้ว
ชื่อ...... นามสกุล......
ชื่อเข้าใช้งาน...........
รหัสผ่าน........

รบกวนหน่อยนะครับ ขอบคุณมากครับ

โค้ด: เลือกทั้งหมด

<?php include("header.php");?>
<?php require_once('Connections/connlogistic.php'); ?>
<?php
mysql_select_db($database_connlogistic, $connlogistic);
$query_rsClients = "SELECT users.username, users.password, clients.firstname, clients.lastname, users.user_id, users.status FROM users LEFT JOIN clients ON users.user_id=clients.user_id WHERE users.username='$username'";
$rsClients = mysql_query($query_rsClients, $connlogistic) or die(mysql_error());
$row_rsClients = mysql_fetch_assoc($rsClients);
$totalRows_rsClients = mysql_num_rows($rsClients);
?>
 <table width="100%"  border="0" cellspacing="1" cellpadding="1">
 <tr>
        <td width="20%" bgcolor="#6699CC"  valign="top"><form action="login.php" method="post" name="login_form" id="login_form">
           <br> <table width=100% border=0 align=left cellpadding=0 cellspacing=0>   
              <tr>
              <td bgcolor="#6699CC"> <div align="center"><em><font color="#FFFFFF"><strong>Member login </strong> </font></em></div></td>
              </tr>
                            <tr>
                <td height="50"><div align="center"><strong><font color="#333333" size="1" face="Verdana, Arial, Helvetica, sans-serif">Username</font></strong>
                    <input name=username type=text id=uname2 value="<?php echo $row_rsClients['username']; ?>" size="15" maxlength="20">
                </div></td>
              </tr>
              <tr>
                <td height="50"><div align="center"><strong><font color="#333333" size="1" face="Verdana, Arial, Helvetica, sans-serif">Password</font></strong>
                        <input name=password type=password id=password size="15" maxlength="20">
                </div></td>
              </tr>
              <tr>
                <td height="50" class="menu" valign="middle"><div align="center">
                    <input type=submit name=Submit value=Login>
                    <br>
                </div></td>
              </tr>
            </table>
            </form>
   </td>
        <td width="80%"><p align="center" class="header">&nbsp;</p>
          <p align="center" class="header">
          <table width="60%" border="1" align="center" cellpadding="10" cellspacing="0" bordercolor="#0000FF"> 
            <tr><td><div align="center"><strong>username และ รหัสผ่าน </strong>          </div>
                <p align="center">คุณ<?php echo $row_rsClients['firstname']; ?>&nbsp;<?php echo $row_rsClients['lastname']; ?></p>
          <p align="center">Username คือ <?php echo $row_rsClients['username']; ?></p>
          <p align="center">    Password คือ <?php echo $row_rsClients['password']; ?></p>
          </td></tr></table>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
          <p align="center">&nbsp;</p>
<?php
mysql_free_result($rsClients);
?>

ข้างบน