demettriss
Guest
PHP:
<?php
require_once("config.php") ;
?><!DOCTYPE HTML>
<html>
<head>
<title>Клиенты</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form method="POST">
Ваш ID: <input type="text" name="id">
<br>
<input type="submit" name="okbutton" value="OK">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$id = $_POST['id'];
$query = "SELECT * FROM vs_customer WHER r_item == $id";
$res = mysql_query($query);
if (!$res) {
die ('Ошибка в ДНК: ' . mysql_error());
}
$summ = mysql_num_rows($res);
echo "<center>";
if ($summ == 0) {
echo('У Вас - 0 рефералов');
} else {
echo('У Вас - " . $summ . "рефералов<br>');
echo('<TABLE STYLE="border-size: 1px">');
echo('<TR>
<TD>Ф.И.О.</TD>
<TD>Почта</TD>
</TR>');
while($row=mysql_fetch_array($res)){
echo('<TR>
<TD>' . $row['c_surname'] . ' ' . $row['c_name'] . ' ' . $row['c_patronymic'] . '</TD>');
echo('<TD>' . $row['c_mail'] . '</TD>
</TR>');
}
echo('</TABLE>');
}
echo "</center>";
}
?>
</body>
</html>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'r_item == 1' at line 1