PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| <?php $db_connect = mysql_connect ('localhost', 'airliner_gijs', '**') or die ('I cannot connect to the database because:<br><br>' . mysql_error()); $db_select = mysql_select_db('airliner_gijs', $db_connect)or die('Unable to select gijs_airliner' . mysql_error()); echo 'You have successfully connected to MySQL!'; $username = $_GET['username']; $text = $_GET['text']; $sql = 'INSERT INTO guestbook (username, text) VALUES ('.$username.', '.$text.')'; $result = @mysql_query($sql,$conn) or die('Couldn't execute query.'); echo 'You have successfully inserted:<br>'.$username.'<br>'.$text.'; mysql_close($db_connect); ?> |
sorry