ragazzi questo script:
Codice PHP:
<?php
$mysql = new mysql('skizzo', '15421542', 'localost', 'my_skizzo.articles');
if(!$mysql)
{
die("Errore di connessione al database, impossibile procedere");
}
if(isset($_POST['action']) and $_POST['action'] == 'insert')
{
$mysql->query("INSERT INTO articles VALUES ('', '".$_POST['author']."', '".addslashes($_POST['title'])."', '".addslashes($_POST['article'])."')");
header('Location: index.php');
}
$authors = $mysql->query("SELECT id, CONCAT(surname, ' ', name) AS fullname FROM authors ORDER BY surname ASC");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Inserimento articolo</title>
</head>
<body>
<ul>[*][url="News.php"]Lista articoli[/url][*][url="insert.php"]Inserisci un articolo[/url][/list]
<h3>Inserisci un articolo</h3>
<form action="" method="post">
<input type="hidden" name="action" value="insert"/>
<label>Autore:</label> <select name="author">
<?php
while($author = $authors->fetch_assoc())
{
echo "<option value=".$author['id'].">".$author['fullname']."</option>";
}
?>
</select>
<label>Titolo:</label> <input type="text" name="title" size="55"/>
<label>Text:</label>
<textarea name="article" rows="6" cols="60"></textarea>
<input type="submit" value="Salva"/>
</form>
</body>
</html></div>
</div>
</body>
</html>
mi da questo errore:
Fatal error: Cannot instantiate non-existent class: mysql in /membri/sk1zzo/insert.php on line 182