|
|
|
ช่วยดู Error ตัวนี้หน่อยครับ ขอบคุณครับ ..................... |
|
|
|
|
|
|
|
register.php
<html>
<head>
<title>ThaiCreate.Com Tutorials</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<form action="Add_Register.php" method="post" name="Formregis" id="Formregis">
Register Form <br>
<table width="400" height="472" border="1" style="width: 400px">
<tbody>
<tr>
<td width="125"> Username</td>
<td width="180">
<input name="Username" type="text" id="Username">
</td>
</tr>
<tr>
<td> Password</td>
<td><input name="Password" type="password" id="Password">
</td>
</tr>
<tr>
<td> Confirm Password</td>
<td><input name="ConPassword" type="password" id="ConPassword">
</td>
</tr>
<tr>
<td> Name</td>
<td><input name="Name" type="text" id="Name" size="0"></td>
</tr>
<tr>
<td> Surname</td>
<td><label for="txtSurame"></label>
<input type="text" name="Surname" id="Surname"></td>
</tr>
<tr>
<td> Gender</td>
<td><p>
<label>
<input type="radio" name="gender" value="male" id="gender_0">
male</label>
<br>
<label>
<input type="radio" name="gender" value="female" id="gender_1">
female</label>
<br>
</p></td>
</tr>
<tr>
<td>Age</td>
<td> <label for="age"></label>
<select name="age" id="age">
<option value="9-18" selected="selected">9-18 ปี</option>
<option value="19-25">19-25 ปี</option>
<option value="26-45">26-45 ปี</option>
<option value="46-60">46-60 ปี </option>
<option value="61-80">61-80 ปี</option>
</select></td>
</tr>
<tr>
<td> Email</td>
<td><label for="Email"></label>
<input type="text" name="Email" id="Email"></td>
</tr>
<tr>
<td height="87"> Address</td>
<td><label for="Address"></label>
<textarea name="Address" id="Address" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td height="26"> Zipcode</td>
<td><label for="zipcode"></label>
<input type="text" name="zipcode" id="zipcode"></td>
</tr>
<tr>
<td height="26"> Country</td>
<td><label for="Country"></label>
<input type="text" name="Country" id="Country"></td>
</tr>
<tr>
<td height="26"> Phone</td>
<td><label for="Phone"></label>
<input type="text" name="Phone" id="Phone">
<label for="idcard"></label></td>
</tr>
<tr>
<td height="26"> ID Card</td>
<td><input type="text" name="idcard" id="idcard"></td>
</tr>
<tr>
<tr>
<td> Status</td>
<td><select name="ddlStatus" id="ddlStatus">
<option value="ADMIN" selected="selected">ADMIN</option>
<option value="USER">USER</option>
</select></td>
</tr>
</table>
<input type="submit" name="Submit" value="Save">
<br>
</form>
</body>
</html>
Add_Register.php
<?php
include("config.inc.php");
$sql = "insert into 'member'('Username','Password','Name','Surname','gender','age','Email','Address','zipcode','Country','Phone','idcard','Status')
values('$Username','$Password','$Name','$Surname','$gender','$age','$Email','$Address','$zipcode','$Country','$Phone','$idcard','$ddlStatus')";
$sqlquery=mysql_db_query($DBName,$sql);
$checkapp = "selsct*from 'member' where Username='$Username'";
$result = mysql_db_query($DBName,$checkapp);
$num=mysql_num_rows($result);
if($sum==1)
{
print"<br> สมัครสมาชิกเรียบร้อยแล้ว";
}
mysql_close();
?>
นี้คือ Error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\new\Add_Register.php on line 8
Tag : PHP
|
ประวัติการแก้ไข 2012-06-30 16:06:41
|
|
|
|
|
Date :
2012-06-30 15:32:52 |
By :
seedcool |
View :
919 |
Reply :
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'member' ตรงนี้เลย ' โควท
|
|
|
|
|
Date :
2012-06-30 15:51:13 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาตรง member ออกครับ 2 จุด
|
|
|
|
|
Date :
2012-06-30 16:43:58 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ ขอบคุณน่ะครับ ผมเขียนไฟล์ Add_Register.php ใหม่เลย ฮ่าๆ
|
|
|
|
|
Date :
2012-06-30 16:58:39 |
By :
cappuczino |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code
'member'('Username','Password','Name','Surname','gender','age','Email','Address','zipcode','Country','Phone','idcard','Status')
นี่ครับ เอา ' ออกทั้งหมดเลย
|
|
|
|
|
Date :
2012-06-30 18:08:40 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|