Thanks for link, I studed it.
I wrote my egsample from that guide, but it didn't work π
Maybe you will see an error (then I press add genre url, nothing hapen).
<?php
include("dbinfo.inc.php");
if (isset($addgenre)):
?>
<form action="<?=$PHP_SELF?>" method="post">
<P>
Enter genre: <INPUT type="text" name="genrename"><BR>
<INPUT type="submit" name="submitgenre" value="SUBMIT"> <INPUT type="reset">
</P>
</form>
<?php
else:
$dbconx = @mysql_connect($mysql_host,$mysql_user,$mysql_password);
if (!$dbconx) {
echo( "<p>Unable to connect to the " . "database server at this time.<p>");
exit();
}
if (! @mysql_select_db($my_db)) {
echo( "<p>Unable to locate the database at this time.</p>");
exit();
}
// if a genre has ben submitted, addd it to databse
if ($submitgenre == "SUBMIT") {
$sql = "INSERT INTO genre VALUES (,$genrename)";
if (@($sql)){
echo("<p>Genre has been added.</p>");
} else {
echo("<p>Error adding submitet genre: " .
mysql_error() . "</p>");
}
}
echo("<p> Here all genres in our table: </p>");
$result = @("SELECT genre_name FROM genre");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
while ($row = mysql_fetch_array($result) ) {
echo("<p>" . $row["genre_name"] . "</p>"); }
echo("<p> <a href='$PHP_SELF?addgenre=1'> Add a genre! </a> </p>");
endif;
?>