login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/wandelenmetannet.nl/httpdocs/Kalender/index php on line 41

Offline demingel - 20/08/2005 10:14
Avatar van demingelNieuw lid Hoi ik heb net een kalender geinstalleerd maar krijg de bovenstaande foutmelding.
onderstaande pagina is de index pagina waar de fout ergens in zit

  1. Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/wandelenmetannet.nl/httpdocs/Kalender/index.php on line 41


  1. <?
  2. require_once("includes/config.php");
  3.  
  4. if(!isset($installed))
  5. {
  6. header("Location: install.php");
  7. }
  8. else
  9. {
  10. if(file_exists('install.php'))
  11. {
  12. header("Location: install.php");
  13. }
  14. }
  15.  
  16. $db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());
  17. $db_select = mysql_select_db ($DBName) or die (mysql_error());
  18. $db_table = $TBL_PR . "events";
  19.  
  20. function getmicrotime(){
  21. list($usec, $sec) = explode(" ",microtime());
  22. return ((float)$usec + (float)$sec);
  23. }
  24.  
  25. $time_start = getmicrotime();
  26.  
  27. IF(!isset($_GET['year'])){
  28. $_GET['year'] = date("Y");
  29. }
  30. IF(!isset($_GET['month'])){
  31. $_GET['month'] = date("n")+1;
  32. }
  33.  
  34. $month = addslashes($_GET['month'] - 1);
  35. $year = addslashes($_GET['year']);
  36.  
  37. $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";
  38. $query_result = mysql_query ($query);
  39. while ($info = mysql_fetch_array($query_result))
  40. {
  41. $day = $info['event_day'];
  42. $event_id = $info['event_id'];
  43. $events[$day][] = $info['event_id'];
  44. $event_info[$event_id]['0'] = substr($info['event_title'], 0, 8);;
  45. $event_info[$event_id]['1'] = $info['event_time'];
  46. }
  47.  
  48. $todays_date = date("j");
  49. $todays_month = date("n");
  50.  
  51. $days_in_month = date ("t", mktime(0,0,0,$_GET['month'],0,$_GET['year']));
  52. $first_day_of_month = date ("w", mktime(0,0,0,$_GET['month']-1,1,$_GET['year']));
  53. $first_day_of_month = $first_day_of_month + 1;
  54. $count_boxes = 0;
  55. $days_so_far = 0;
  56.  
  57. IF($_GET['month'] == 13){
  58. $next_month = 2;
  59. $next_year = $_GET['year'] + 1;
  60. } ELSE {
  61. $next_month = $_GET['month'] + 1;
  62. $next_year = $_GET['year'];
  63. }
  64.  
  65. IF($_GET['month'] == 2){
  66. $prev_month = 13;
  67. $prev_year = $_GET['year'] - 1;
  68. } ELSE {
  69. $prev_month = $_GET['month'] - 1;
  70. $prev_year = $_GET['year'];
  71. }
  72.  
  73.  
  74.  
  75. ?>
  76. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  77. <html>
  78. <head>
  79. <title>Wandelen met annet.nl</title>
  80. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  81. <link href="images/cal.css" rel="stylesheet" type="text/css">
  82. <script language="JavaScript" type="text/JavaScript">
  83. <!--
  84. function MM_jumpMenu(targ,selObj,restore){ //v3.0
  85. eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  86. if (restore) selObj.selectedIndex=0;
  87. }
  88. function MM_openBrWindow(theURL,winName,features) { //v2.0
  89. window.open(theURL,winName,features);
  90. }
  91. //-->
  92. </script>
  93. </head>
  94.  
  95. <body>
  96. <div align="center"><span class="currentdate"><? echo date ("F Y", mktime(0,0,0,$_GET['month']-1,1,$_GET['year'])); ?></span><br>
  97. <br>
  98. </div>
  99. <div align="center"><br>
  100. <table width="700" border="0" cellspacing="0" cellpadding="0">
  101. <tr>
  102. <td><div align="right"><a href="<? echo "index.php?month=$prev_month&amp;year=$prev_year"; ?>">&lt;&lt;</a></div></td>
  103. <td width="200"><div align="center">
  104.  
  105. <select name="month" id="month" onChange="MM_jumpMenu('parent',this,0)">
  106. <?
  107. for ($i = 1; $i <= 12; $i++) {
  108. $link = $i+1;
  109. IF($_GET['month'] == $link){
  110. $selected = "selected";
  111. } ELSE {
  112. $selected = "";
  113. }
  114. echo "<option value=\"index.php?month=$link&amp;year=$_GET[year]\" $selected>" . date ("F", mktime(0,0,0,$i,1,$_GET['year'])) . "</option>\n";
  115. }
  116. ?>
  117. </select>
  118. <select name="year" id="year" onChange="MM_jumpMenu('parent',this,0)">
  119. <?
  120. for ($i = 2000; $i <= 2010; $i++) {
  121. IF($i == $_GET['year']){
  122. $selected = "selected";
  123. } ELSE {
  124. $selected = "";
  125. }
  126. echo "<option value=\"index.php?month=$_GET[month]&amp;year=$i\" $selected>$i</option>\n";
  127. }
  128. ?>
  129. </select>
  130. </div></td>
  131. <td><div align="left"><a href="<? echo "index.php?month=$next_month&amp;year=$next_year"; ?>">&gt;&gt;</a></div></td>
  132. </tr>
  133. </table>
  134. <br>
  135. </div>
  136. <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
  137. <tr>
  138. <td><table width="100%" border="0" cellpadding="0" cellspacing="1">
  139. <tr class="topdays">
  140. <td><div align="center">Zondag</div></td>
  141. <td><div align="center">Maandag</div></td>
  142. <td><div align="center">Dinsdag</div></td>
  143. <td><div align="center">Woensdag</div></td>
  144. <td><div align="center">Donderdag</div></td>
  145. <td><div align="center">Vrijdag</div></td>
  146. <td><div align="center">Zaterdag</div></td>
  147. </tr>
  148. <tr valign="top" bgcolor="#FFFFFF">
  149. <?
  150. for ($i = 1; $i <= $first_day_of_month-1; $i++) {
  151. $days_so_far = $days_so_far + 1;
  152. $count_boxes = $count_boxes + 1;
  153. echo "<td width=\"100\" height=\"100\" class=\"beforedayboxes\"></td>\n";
  154. }
  155. for ($i = 1; $i <= $days_in_month; $i++) {
  156. $days_so_far = $days_so_far + 1;
  157. $count_boxes = $count_boxes + 1;
  158. IF($_GET['month'] == $todays_month+1){
  159. IF($i == $todays_date){
  160. $class = "highlighteddayboxes";
  161. } ELSE {
  162. $class = "dayboxes";
  163. }
  164. } ELSE {
  165. IF($i == 1){
  166. $class = "highlighteddayboxes";
  167. } ELSE {
  168. $class = "dayboxes";
  169. }
  170. }
  171. echo "<td width=\"100\" height=\"100\" class=\"$class\">\n";
  172. $link_month = $_GET['month'] - 1;
  173. echo "<div align=\"right\"><span class=\"toprightnumber\">\n<a href=\"javascript:MM_openBrWindow('event_add.php?day=$i&amp;month=$link_month&amp;year=$_GET[year]','','width=500,height=300');\">$i</a>&nbsp;</span></div>\n";
  174. IF(isset($events[$i])){
  175. echo "<div align=\"left\"><span class=\"eventinbox\">\n";
  176. while (list($key, $value) = each ($events[$i])) {
  177. echo "&nbsp;<a href=\"javascript:MM_openBrWindow('event.php?id=$value','','width=500,height=200');\">" . $event_info[$value]['1'] . " " . $event_info[$value]['0'] . "</a>\n<br>\n";
  178. }
  179. echo "</span></div>\n";
  180. }
  181. echo "</td>\n";
  182. IF(($count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){
  183. $count_boxes = 0;
  184. echo "</TR><TR valign=\"top\">\n";
  185. }
  186. }
  187. $extra_boxes = 7 - $count_boxes;
  188. for ($i = 1; $i <= $extra_boxes; $i++) {
  189. echo "<td width=\"100\" height=\"100\" class=\"afterdayboxes\"></td>\n";
  190. }
  191. $time_end = getmicrotime();
  192. $time = round($time_end - $time_start, 3);
  193. ?>
  194. </tr>
  195. </table></td>
  196. </tr>
  197. </table>
  198. <p align="center"><span class="footer">&copy; 2005
  199. <a href="http://www.phpcalendars.com">PHPCalendars.com</a><br>
  200. Script Execution Time: <? echo $time; ?></span><br><br>
  201.  
  202. </body>
  203. </html>

9 antwoorden

Gesponsorde links
Offline cracker - 20/08/2005 10:27
Avatar van cracker Onbekend een kolom ofzo bestaat niet.
voeg mysql_error() toe aan uw query.
  1. $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";
  2. $query_result = mysql_query ($query) or die(mysql_error());
Offline demingel - 20/08/2005 11:07 (laatste wijziging 20/08/2005 11:08)
Avatar van demingel Nieuw lid Dus onderstaand moet ik in regel 41 veranderen??


  1. $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";
  2. $query_result = mysql_query ($query) or die(mysql_error());


ik heb dit geprobeerd maar krijg dus een foutmelding
Citaat:
Unknown column 'event_id' in 'field list'
Offline cracker - 20/08/2005 11:10
Avatar van cracker Onbekend da's geen fout.
Da's de uitleg wat je moet doen om de fout te verwijderen.

PHP vindt geen kolom met de naam 'event_id' in de tabel.
Offline Rens - 20/08/2005 11:10
Avatar van Rens Gouden medaille

Crew algemeen
Dan ben je in je SQL tabel vergeten om de kolom event_id aan te maken.

Unknown column = onbekende kolom
event_id in = <kolomnaam> in
field list = velden lijst
Offline demingel - 20/08/2005 11:19 (laatste wijziging 20/08/2005 11:24)
Avatar van demingel Nieuw lid ik hoefde volgende de installatie ook geen sql tabellen aan te maken
ik heb nu het volgende gedaan
ik heb alles van regel 40 t/m 42 verwijderd en nu heb ik dus geen foutmelding meer 

Maar als ik me dus nu inlog kan ik dus geen event toevoegen:?:
kon ik hiervoor ook al niet
Offline cracker - 20/08/2005 11:25 (laatste wijziging 20/08/2005 11:27)
Avatar van cracker Onbekend Het script verwijderen is geen oplossing ae 
geef eens de URL van die pagina.
Offline demingel - 20/08/2005 11:28
Avatar van demingel Nieuw lid http://www.wand...;year=2005
Offline cracker - 20/08/2005 11:32
Avatar van cracker Onbekend Ik vermoed dat al die fouten voortkomen uit uw mySQL versie of je hebt gewoon die scripts van phpcalendar.com verkeerd geïnstalleerd.
Offline demingel - 20/08/2005 11:34
Avatar van demingel Nieuw lid ik zal proberen om hem opnieuw te installeren.
in ieder geval bedankt voor de moeite
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.243s