PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to define $std_name to the phpmyadmin Posted by bae on 4 Jul 2009 at 2:10 AM
how to add $std_name to database
<form id="form1" name="form1" method="post" action="thankstudent.php">
<table width="435" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="#000000">
<tr>
<td width="111" bgcolor="#00FFFF">Title</td>
<td width="329"><label>
<input name="title" type="text" id="title" size="80" />
</label></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#00FFFF"><div align="left">Description</div></td>
</tr>
<tr>
<td height="48" colspan="2" align="center"><label>
<textarea name="description" id="description" cols="905" rows="5"></textarea>
</label></td>
</tr>
<tr>
<td bgcolor="#00FFFF"><div align="left"><span class="style8">Year</span></div></td>
<td><SELECT NAME="year" size="1">
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>
<option>2020</option>
</SELECT></td>
</tr>
<td bgcolor="#00FFFF"><div align="left">Member Name</div></td>
<td><p>1.
<input name="std_name" type="text" id="st_dname" size="50" />
</p>
<p>2.
<input name="std_name" type="text" id="std_name" size="50" /> </p>

<p>3.
<input name="std_name" type="text" id="std_name" size="50" /></p>
<p>4.
<input name="std_name" type="text" id="std_name" size="50" />
</p><p>5.
<input name="std_name" type="text" id="std_name" size="50" />
</p></td><tr>
<td bgcolor="#00FFFF"><div align="left">Total Pages</div></td>
<td><label>
<input type="text" name="textfield5" id="textfield5">
</label></td>
</tr>
<tr>
<td colspan="2" align="center">

<div align="left">
<input type="submit" name="button4" id="button4" value="submit" />
<input type="reset" name="button3" id="button3" value="cancel" />
</div></td>
</tr>
</table>
</form>



receive file

CODE
<?php
include('connect_login.php');
$title = $_POST['title'];
$description = $_POST['description'];
$std_name = $_POST['std_name'];
$total_pages = $_POST['total_pages'];


$sql = "INSERT INTO `text`.`developer` (`id` ,`title` ,`description` ,`year` ,`std_name` ,`total pages` )VALUES ('', '$title', '$description', '', '$std_name', '$total_pages');";

mysql_query($sql);

?>


the error is no $std_name in database due to incorrect code
my question is "how to correct it?"



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.