MySQL interesse |
|
Wat doe ik fout?
database.php:
<?php
function database_connect(&$link)
{
$link = mysqli_connect('localhost', 'user', 'pass', 'database') or die ('Errrorrrr<br />');
}
?>
<?php function database_connect(&$link) { $link = mysqli_connect ('localhost', 'user', 'pass', 'database') or die ('Errrorrrr<br />'); } ?>
page.php:
<?php
//openen van database connectie
database_connect(&$link);
//query definieren
$query = 'SELECT * FROM page WHERE lang == '.$lang.' AND page == '.$page.' ORDER BY id';
//query uitvoeren
$res = mysqli_query(&$link, $query);
//query fetchen
$row = mysqli_fetch_assoc($res);
?>
<?php //openen van database connectie database_connect(&$link); //query definieren $query = 'SELECT * FROM page WHERE lang == '.$lang.' AND page == '.$page.' ORDER BY id'; //query uitvoeren $res = mysqli_query(&$link, $query); //query fetchen $row = mysqli_fetch_assoc($res); ?>
Foutmelding:
Citaat: Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /home/chilion/domains/chilion.nl/public_html/komvoort/page.php on line 24
|