Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Error in Create Database Table

$
0
0
got this error when executing my php.
"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 7"

validate.php
<?php

$host="localhost"; // Host name 
$username="root"; // Mysql username 
$password=""; // Mysql password 
$db_name="gradingsys_db"; // Database name 
$tbl_name = mysql_real_escape_string($_POST['gs_name']); 

//connet database
$con = mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
// Create table
mysql_select_db("$db_name") or die(mysql_error());

// create table
mysql_query("CREATE TABLE $tbl_name(
uid int (255) NOT NULL AUTO_INCREMENT,
stnd_name varchar(255),
stnd_id varchar(255),
adviser varchar(255),
sy varchar(255),
)") or die(mysql_error());

echo "Table Created!";
mysql_close($con);

?>




and for my html
<div id="layer1" style="position: absolute; width: 923px; height: 574px; z-index: 1; left: 14px; top: 4px">
	<p class="auto-style1"><strong>CREATE SECTION</strong></p>
	<form method="post" action="validate.php" class="auto-style2">
	
		Grade-Section Name:
		<input name="gs_name" style="width: 248px" type="text" /> <br />
		<input name="Button1" style="width: 108px" type="submit" value="Create Section" /><br />
	</form>
	 
	 
	<p><strong>LIST OF GRADES/SECTIONS</strong></p>
	<table style="width: 100%; height: 127px" border="1px" cellspacing="0">
	
	</table>
</div>



any one?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>