Here's the code I'm using to inert the reviews into the database;
Expand|Select|Wrap|Line Numbers
- <?php
- $dbc = mysql_connect('localhost', 'communi3_root', 'NotTheRealPassword');
- mysql_select_db('communi3_cfds',$dbc);
- $monicker = $_POST['monicker'];
- review = $_POST['review'];
- $query = "INSERT INTO reviews
- (monicker, review)
- VALUES ('$monicker', '$review' );";
- if (mysql_query($query, $dbc))
- {
- print '<p>The review has been submitted!</p>';
- } else
- {
- print '<p style="color: red;">Could not add the review because:<br />' .mysql_error($dbc) . '</p>';
- }
- ?>
Basically, I haven't got much experience in this kind of thing (should be only too obvious from the amateurish code) but I'd really like to get this working. I had it working in production but it just won't work in development. I got it to the point where it looked ok, but when I tested it, the reviews were not being stored in the database. I also have code to display the reviews when a user clicks a button, but that seems to be fine.