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 ')' at line 1
aqui mi php:
Código PHP:
<?php
$state = false;
if ($_POST['action'] == "add") {
$conexion = mysql_connect("localhost", "usuario", "password_db");
mysql_select_db("base_de_datos", $conexion);
$que = "INSERT INTO smf_members (memberName, realName, passwd, emailAddress) ";
$que.= "VALUES ('".$_POST['memberName']."', '".$_POST['realName']."', '".$_POST['passwd']."', '".$_POST['emailAddress']."',) ";
$res = mysql_query($que, $conexion) or die(mysql_error());
$state = true;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Insertar datos en MySQL</title>
<style type="text/css">
<!--
body {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 12px;
color: #333333;
}
h2 {
font-size: 16px;
color: #CC0000;
}
input, select {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 11px;
color: #666666;
}
.style4 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
-->
</style>
</head>
<body>
<h2>Ingresar Datos de Usuario </h2>
<form id="insertar" name="insertar" method="post" action="">
<table width="41%" border="0">
<tr>
<td width="20%"><span class="style4">Login:</span></td>
<td width="3%"> </td>
<td width="77%"><input name="memberName" type="text" id="memberName" size="50" /></td>
</tr>
<tr>
<td class="style4">Nombre Foro:</td>
<td> </td>
<td><input name="realName" type="text" id="realName" size="50" /></td>
</tr>
<tr>
<td class="style4">Password:</td>
<td> </td>
<td><input name="passwd" type="password" id="passwd" size="50" /></td>
</tr>
<tr>
<td class="style4">Email:</td>
<td> </td>
<td><input name="emailAddress" type="text" id="emailAddress" size="50" /></td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Insertar Registro" />
<input type="hidden" name="action" value="add" />
</p>
</form>
<?php if ($state) { ?>
<p><em>Registro insertado correctamente</em></p>
<?php } ?>
</body>
</html>
Salu2