[PHP+SQL] בעיה מוזרה כשאני מנסה להכניס מידע לתוך טבלה....
שלום.
אני עובד על משהו קטן ... היתי צריך שם ליצור עמוד הרשמה...הכל טוב ויפה...אבל הבעיה היא שאחרי שאני מנסה להירשם זה מביא לי את הבעיה:
Column count doesn't match value count at row 1
מה היא אומרת בכלל? שכאילו השיאלתה שמכניסה את הנתונים השם של אחד השורות לא נכון?
אהההההם אני לא יודע אם זה יעזור אבל הנה עמוד ההרשמה:
PHP קוד:
<?php
define ("PHP_FILE", true);
if(!$_COOKIE['membersU']) {
include 'head.php';
$s1 = mysql_query("SELECT * FROM `global` WHERE `id`=1") or die(mysql_error());
$s1 = mysql_fetch_assoc($s1);
$url = $s1['surl'];
if(isset($_POST['submit'])) {
$user = $_POST["user"];
if($user == "") {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לציין שם משתמש\"); history.go (-1);</script>");
}
$password = $_POST["password"];
$passwordM = md5($password);
$password2 = $_POST["password2"];
$password2M = md5($password2);
if($password == "") {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לציין סיסמא\"); history.go (-1);</script>");
}
if($passwordM != $password2M) {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: הסיסמאות שהקלדת אינן תואמות\"); history.go (-1);</script>");
}
$email = $_POST["email"];
if($email == "") {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לציין כתובת אימייל\"); history.go (-1);</script>");
}
$date = date("d/m/Y");
$ip = $_SERVER['REMOTE_ADDR'];
$err = 0;
$checkvaild = mysql_query("SELECT * FROM `members`");
while($users = mysql_fetch_array($checkvaild)) {
if ($users["user"] == $user || $users["email"] == $email) { $err = 1; }
}
if ($err == 1) { die("<script type=\"text/javascript\">window.alert(\"שגיאה: שם משתמש או אימייל תפוסים\"); history.go (-1);</script>");
} else {
$chars = "ABCDEFGHIJLMNPQRSTUVWXYZ123456789";
srand ((float)microtime() * 1000000);
$i = 0;
$code = '';
while ($i <= 7) {
$num = rand () % 33;
$tmp = substr ($chars, $num, 1);
$code = $code.$tmp;
$i++;
}
mysql_query("INSERT INTO `members` ( `user` , `password` , `email` , `date` , `ip``code` , `active` , `level` )valueS ('$user', '$passwordM', '$email', '$date', '$ip', '$code', 'no', '0')") or die(mysql_error());
$idcheck = mysql_query("SELECT * FROM `members` where `user`='$user'");
$idfinal = mysql_fetch_array($idcheck);
$id = $idfinal['id'];
$emailsend = "תודה שנרשמתה
אנא זכור פרטים אלה
-------------------------
מספר זהות - $id
שם משתמש - $user
סיסמא - $password
-------------------------
לחץ כאן על מנת לאמת את החשבון משתמש:
{$url}activate.php?user=$id&CODE=$code
";
mail("$email", "פרטים להרשמתך", "$emailsend");
echo "<p><b>ההרשמה בוצעה בהצלחה!</b><br /> ברגעים אלא נשלח אליך אימייל עם לינק לאימות המשתמש! אנא לחץ/י אליו על מנת שהמשתמש יהיה פעיל!<br />פעולת השליחה עשויה להימשך מספר דקות.<br />בתודה צוות ההנלה.<br /><br /><a href=\"index.php\">חזרה לעמוד הראשי של האתר</a></p>";
include 'foot.php';
}
}else{
echo '<form action="register.php" method="post">
<table border="0">
<tr>
<td>
שם משתמש:
</td>
<td>
<input type="text" name="user" size="20" />
</td>
</tr>
<tr>
<td>
סיסמא:
</td>
<td>
<input type="password" name="password" size="20" />
</td>
</tr>
<tr>
<td>
סיסמא:
<span style="font-size: 8pt; color: #FF0000">(שוב)</span>
</td>
<td>
<input type="password" name="password2" size="20" />
</td>
</tr>
<tr>
<td>
אימייל:
<span style="font-size: 8pt; color: #FF0000">(חובה לציין אמיתי)</span>
</td>
<td>
<input type="text" name="email" size="20" />
</td>
</tr>
<tr><td></td></tr>
<tr>
<td>
<input type="submit" name="submit" value="הרשם!" />
</td>
</tr>
</table>
</form>';
include 'foot.php';
}
}else{
header("Location: cpanel.php");
exit;
}
?>
אני יודע שזה קצר|קורץ|
תודה מראש לכל העוזרים.
|