Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi , everybody
this is my html page, where a user enters a category name to be added to database.
[syntax="html"]<form action="http://localhost/Admin/confcategory.php" method="post">
<h4>ADD new CATOGARY into the DataBase</h4><table cellspacing="1" cellpadding="1" width="75%" align="center" border="1" bgcolor="66CCFF">
<tr>
<td>
Enter the Catgory Name: <input type="text" name="CName">
<br>
<br>
<input type="submit" name="submit" value="submit">
<input type="Reset" value="Reset" size="20">
</td>
</tr>
</form> This is my PHP code confcategory .when a user clicks on submit on 1st page a data is directly added to database.[/syntax]
Code: Select all
<?php
// Set global variables to easier names
$cname = $_POST['CName'];
$query ="insert into category(cname)". "VALUES ('".$cname."')";
$result = mysql_db_query($db_name,$query);
if (!$result) {
echo("ERROR: " . mysql_error() . "\n$query\n"); }
else
{
echo ("\nNew Link Added\n\n");
$q ="select * from category";
$r = mysql_db_query($db_name,$q);
echo "<tr> CID CName ";
while($row = mysql_fetch_array($r))
{
echo " \n";
echo "\n " . $row['CID'] . " ";
echo "\n " . $row['CName'] . " ";
echo " \n";
}
}
mysql_close( $link );
?>How to do this Please helpme how to code a Frame containing a Yes and No option in frame
Please help!
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]