I just finished reading Build your own Database Driven Website by Kevin Yank and decided to edit some of the php so I could use the Administrative pages.. I'm using the source code from chapter 9 in admin folder.
The only thing I've edited was changing "joke" to "article". What i did was use Dreamweaver's find/replace feature to replace every "joke" instance with "article".. I tipple checked everything to make sure "joke" instances were the only things that were changed (along with the associated MySQL table name) and caps/plurals are where they should be.
Everything seems to be fine with the revised code except whenever I try to submit a new article (joke) or delete an author, I get:
[B]when I try to submit article:[/B]
Error adding submitted article.
[B]When I try to delete author:[/B]
Error getting list of articles to delete.
include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
$text = mysqli_real_escape_string($link, $_POST['text']);
$author = mysqli_real_escape_string($link, $_POST['author']);
if ($author == '')
$error = 'You must choose an author for this article.
Click ‘back’ and try again.';
$sql = "INSERT INTO article SET
if (!mysqli_query($link, $sql))
$error = 'Error adding submitted article.';
I'm guessing the problem is in this portion of the jokes index located in admin folder, but it's identical to the original source code except for "article" so I'm stuck because my includes folder is updated and it can't be a connection issue with MySQL because the rest of the scripts are running fine. Any suggestions as to what the problem might be?