login  Naam:   Wachtwoord: 
Registreer je!
 Forum

witte pagina bij query

Offline IceCold - 03/10/2004 21:34
Avatar van IceColdNieuw lid <?
isempty($_GET['catid']);
isempty($_POST['topic']);
isempty($_POST['bericht']);


// Checking Var's

$catid = $_GET['catid'];
$topic = htmlspecialchars($_POST['topic']);
$bericht = htmlspecialchars($_POST['bericht']);
$datum = date('d - m - y');
$posterid = 1;
$sticky = "nee";
$gesloten = "nee";
$query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
mysql_query($query) or die(mysql_error());
?>


<?
function isempty()


function isempty($value) {
if(!isset($value)) {
echo "ERROR!";
}
elseif($value == "") {
echo "ERROR!";
}
}
?>

5 antwoorden

Gesponsorde links
Offline MothZone - 03/10/2004 21:44
Avatar van MothZone PHP ver gevorderde zet je functie bovenaan de code ipv onderaan
Offline IceCold - 03/10/2004 21:46 (laatste wijziging 03/10/2004 21:46)
Avatar van IceCold Nieuw lid de functie zit in configfile

heel de code

  1. <? include('config.php'); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title><?=$pagina_titel; ?></title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. <style type="text/css">
  8. <!--
  9. a:link {
  10. color: #000000;
  11. }
  12. a:visited {
  13. color: #000000;
  14. }
  15. a:hover {
  16. color: #000000;
  17. }
  18. a:active {
  19. color: #000000;
  20. }
  21. body,td,th {
  22. font-family: Verdana, Arial, Helvetica, sans-serif;
  23. color: #000000;
  24. font-size: x-small;
  25. }
  26. body {
  27. background-color: #FFFFFF;
  28. }
  29. .titels {
  30. color: #FFFFFF;
  31. font-weight: bold;
  32. }
  33. .style5 {
  34. font-size: small;
  35. font-weight: bold;
  36. }
  37. -->
  38. </style></head>
  39.  
  40. <body>
  41. <div align="center">
  42. <table width="650" border="0" cellspacing="0" cellpadding="0">
  43. <tr>
  44. <td>
  45.  
  46. <?
  47. isempty($_GET['catid']);
  48. isempty($_POST['topic']);
  49. isempty($_POST['bericht']);
  50.  
  51.  
  52. // Checking Var's
  53.  
  54. $catid = $_GET['catid'];
  55. $topic = htmlspecialchars($_POST['topic']);
  56. $bericht = htmlspecialchars($_POST['bericht']);
  57. $datum = date('d - m - y');
  58. $posterid = 1;
  59. $sticky = "nee";
  60. $gesloten = "nee";
  61.  
  62. $query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
  63. mysql_query($query) or die(mysql_error());
  64. ?>
  65. test
  66. </td>
  67. </tr>
  68. </table>
  69. <br />
  70. <br />
  71. <? include('copyright.php'); ?>
  72. </div>
  73. </body>
  74. </html>
Offline SickBoy - 03/10/2004 21:54
Avatar van SickBoy MySQL beginner wat zegt de broncode ??
Offline IceCold - 03/10/2004 22:07
Avatar van IceCold Nieuw lid error ==>



ERROR!
Column count doesn't match value count at row 1
Offline DRUNK - 03/10/2004 23:26 (laatste wijziging 03/10/2004 23:26)
Avatar van DRUNK PHP gevorderde
  1. <?php
  2. $query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
  3. ?>


bekijk dat stukje eens? Je hebt 7 (zeven) velden, en je wilt er 8 (acht) gegevens in stoppen. Lees nu de foutmelding opnieuw.......En wat is er fout?
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.187s