0

I have a error on my php code. I will insert a new row And i get the error: wrong parameter count in mysql_query

<?php
 include('../sec/inc_mysql_connect.php');
 include 'googledistance.class.php';
 $sql = "SELECT VVBnummer, Adres, Postcode FROM tblscheidsrechters";// echo($sql);
 $result = mysql_query($sql);

 $sql_sh = "SELECT ID, SporthalAdres, Postcode FROM tblsporthal"; //echo('<br>' .    $sql_sh);
 $result_sh = mysql_query($sql_sh);
 while($record = mysql_fetch_array($result))
 {
  while($record_sh = mysql_fetch_array($result_sh))
  {
$fromAddress = $record['Adres'] . ',' . $record['Postcode']; //echo($fromAddress . '<br>');
   $toaddress = $record_sh['SporthalAdres'] . ',' . $record_sh['Postcode'];  //echo($toaddress . '<br>');

$gd = new GoogleDistance($fromAddress, $toaddress);

$vvb = $record['VVBnummer'];
$shid =  $record_sh['ID'];
$afstand = $gd->getDistance();
$tijd = $gd->getDuration(); 
?>
<body> 
    <p>Scheidsrechter: <?php echo($record['VVBnummer']); ?></p>
    <p>Sporthal: <?php echo($record_sh['ID']); ?></p>        
    <p>Afstand in km (h/t): <?php echo $gd->getDistance()/1000 ; ?></p>
    <p>Tijd in minuten: <?php echo $gd->getDuration()/60; ?></p>
    <p>Gevonden oorsprong: <?php echo $gd->getOrigin(); ?></p>
    <p>Gevonden bestemming: <?php echo $gd->getDestination(); ?></p>
    <hr />
</body>
<?php
 $sql = "INSERT INTO klvv_sr_afstand_sh ( vvb_nr_sr, shid, afstand, tijd) VALUES('$vvb', '$shid', '$afstand', '$tijd')"; echo($sql);
$record = mysql_query();
}
}
?>

The error happens when i will insert the row Thx for the help

4

1 回答 1

1

您需要将查询传递给服务器:

$record = mysql_query($sql);

为了澄清:在你的代码中你说$record = mysql_query();

于 2013-08-24T08:32:01.270 回答