PHP gevorderde |
|
Parse error: parse error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/httpd/vhosts/jb-web.net/httpdocs/mysqli.php on line 3
dat is de code:
<?php
$mysqli = new mysqli('localhost', 'test1', '********', 'test1');
$resultaat = $mysqli->("SELECT * FROM leden_stats");
while ($record = $resultaat->fetch_assoc())
{
print_r($record);
}
echo "<br />Aantal records: " . $resultaat->num_rows;
$veld1 = $mysqli->real_escape_string($veld1);
$veld2 = $mysqli->real_escape_string($veld2);
$resultaat = $mysqli->("INSERT INTO tabel (veld1, veld2) VALUES ('" . $veld1 . "','" . $veld2 . "');");
if ($resultaat == false)
{
echo "Query mislukt. Foutmelding: " . $mysqli->error;
}
else
{
echo "Query gelukt!";
}
mysqli_close($mysqli);
?>
<?php $mysqli = new mysqli('localhost', 'test1', '********', 'test1'); $resultaat = $mysqli->("SELECT * FROM leden_stats"); while ($record = $resultaat->fetch_assoc()) { } echo "<br />Aantal records: " . $resultaat->num_rows; $veld1 = $mysqli->real_escape_string($veld1); $veld2 = $mysqli->real_escape_string($veld2); $resultaat = $mysqli->("INSERT INTO tabel (veld1, veld2) VALUES ('" . $veld1 . "','" . $veld2 . "');"); if ($resultaat == false) { echo "Query mislukt. Foutmelding: " . $mysqli->error; } else { } mysqli_close($mysqli); ?>
|