Ik kan nergens mijn fout vinden. Heb ook flink wat gegoogled maar heb niks gevonden wat mijn probleem oplost, of er naar leid dat ik het kan oplossen..
De error:
Php code: (log.php) regel 1 = regel 25
Mysql class stukje:
Weet iemand dus wat ik fout doe???
De error:
SCREAM: Error suppression ignored for
Warning: Illegal string offset ip in **wampwww******log.php on line 29 Php code: (log.php) regel 1 = regel 25
[COLOR= #0000BB]<?php
$lQ[/COLOR] [COLOR= #007700]=[/COLOR] Mysql[COLOR= #007700]::[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM logs[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<ul [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$class[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR]Mysql[COLOR= #007700]::[/COLOR]assoc[COLOR= #007700]([/COLOR][COLOR= #0000BB]$lQ[/COLOR][COLOR= #007700]) as[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<li>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</li>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</ul>[/COLOR][COLOR= #007700];[/COLOR]
?> Mysql class stukje:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] query[COLOR= #007700]([/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$q[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] assoc[COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);
}[/COLOR]
?> Weet iemand dus wat ik fout doe???
alleen bij codeigniter doen ze het met foreach