View Full Version : PHP database problem

11-30-2006, 10:12 PM
I got this problem: im working on a website that has an admin feature where admin can post messages in the site. Like someone fill comment form and then admin can put the message that is come his email to the website. The structure is probably this : there is template file called newpost.php which has an normal html form which has action="commentmodify.php" so when admin fill the form it will be send to commentmodify.php which check if the information is right and if it is then it will be saved to an sql-database. php code is like this in commentmodify.php

@$link=mysql_connect($host,$dbuser,$dbpass) or die("no connection");
@mysql_select_db($db,$link) or die("no connection");


echo "<table border=0 cellspacing=3 cellpadding=2 width=300><tr>
<td colspan=3 width=100% align=left class=tdheader>Comments' Mnagement</td></tr>";

$query = "INSERT INTO `comment`VALUES ('', 'y','$name')";

@$result=mysql_query($query,$link) or die("no connection");
echo "New comment saved<br>";
else {
echo "No comment was saved";}}


The problem is that newpost has in its form also List/Menu which has
the categories where the posted message should come. so i had to add more categories which i did. now when in admin i fill a form it goes to right catecory/template in the website but it has a limit of 3 message. Previosly there where only 3 categories but you could add as many messages as you want. What could be causing this? Any ideas that i could start working on would be appreciated greatly.