Als ik een nieuwe bericht wil toevoegen aan mijn nieuwsysteem krijg ik een error als ik het wilt versturen.
Foutmelding:
Warning: mysql_query() [function.mysql-query]: Cant connect to local MySQL server through socket /var/run/mysqld/mysqld.sock (2) in /home/vol9/byethost12.com/b12_3698192/htdocs/nieuws/voegtoe.php on line 9
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/vol9/byethost12.com/b12_3698192/htdocs/nieuws/voegtoe.php on line 9
Hij zegt dat ie niet connect maar ik heb dat wel gedaan.
Mijn code:
Foutmelding:
Warning: mysql_query() [function.mysql-query]: Cant connect to local MySQL server through socket /var/run/mysqld/mysqld.sock (2) in /home/vol9/byethost12.com/b12_3698192/htdocs/nieuws/voegtoe.php on line 9
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/vol9/byethost12.com/b12_3698192/htdocs/nieuws/voegtoe.php on line 9
Hij zegt dat ie niet connect maar ik heb dat wel gedaan.
Mijn code:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"../data.inc"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR]bevestiging[COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO nieuws SET "[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"id = "[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]", titel = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]", bericht = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$res[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR]bevestiging[COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"
<form action="voegtoe.php" method="POST">
<input type="hidden" value="1" name="bevestiging" /><br />
<input type="text" name="titel" value="Titel" /><br />
<textarea name="bericht">Bericht</textarea><br />
<input type="reset" value="Reset" />
<input type="submit" value="Submit" />
</form>
"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<a href="admin.php">Ga terug naar de admin</a>"[/COLOR][COLOR= #007700];[/COLOR]
?> 
