mysql_fetch_array(): probleem
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ on line 68
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<? (63) $entries = mysql_query($Select);
$entry = mysql_fetch_array($entries);
if($entry[0] < 1)
{
(68) if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
mysql_query($Insert);
}
}
(76) else
?>
$entry = mysql_fetch_array($entries);
if($entry[0] < 1)
{
(68) if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
mysql_query($Insert);
}
}
(76) else
?>
maar je controleert niet of je query gelukt is. Dit is je ook al meerdere keren aangeraden in dit topic.
Ik moet zeggen dat het niet echt inspirerend is om je te helpen als je onze tips niet opvolgt.
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
if (!entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
?>
if (!entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
?>
had dat wel verandert
maar omdat het geheel niet meer werkte had ik alles op het oude gezet.
zal dat weer terug doen
SanThe schreef op 13.08.2009 20:16:
Foutafhandeling ontbreekt
Query zal mislukt zijn.
Query zal mislukt zijn.
Zoals reeds eerder vermeld.
krijg ik dit
sorry ligt niet aan jullie maar ik probeer alles wel te doen en te leren maar ben hier niet zo erg thuis in .
Ben in het dagelijks leven gewoon zanger .
peetje schreef op 13.08.2009 22:40:
Ben in het dagelijks leven gewoon zanger .
Hahaha! Aangenaam kennis te maken. Ik ben in het dagelijks leven gewoon pianist ;-)
Informatie geven anders kunnen we niks doen.
In wat? Welke regel?
Graag even de regel inclusief de regel ervoor.
in dit
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
if (!entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
?>
if (!entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
?>
gaf geen regel aan daarom had ik het er niet bij gezet.
wilde gewoon een leuk simpel agenda,tje op mijn site zetten pffff
Moet zijn
if (!$entries = mysql_.......
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?
Notice: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and month = and year =' at line 1 in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 68
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 71
Notice: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and month = and year =' at line 1 in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 72
?>
Notice: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and month = and year =' at line 1 in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 68
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 71
Notice: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and month = and year =' at line 1 in /home/aypbfgzi/domains/peterooms.nl/public_html/agenda/agenda-calendar.php on line 72
?>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?
if (!$entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if (!$entry = mysql_fetch_array($entries)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if($entry[0] < 1)
{
if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
mysql_query($Insert);
}
?>
if (!$entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if (!$entry = mysql_fetch_array($entries)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if($entry[0] < 1)
{
if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
mysql_query($Insert);
}
?>
Jan Koehoorn schreef op 13.08.2009 21:32:
Je gebruikt allemaal reserved words voor je kolomnamen.
text mag niet
day mag niet
month mag niet
year mag niet
Die woorden worden intern al gebruikt in MySQL. Verzin andere namen en dan zal het wel werken.
text mag niet
day mag niet
month mag niet
year mag niet
Die woorden worden intern al gebruikt in MySQL. Verzin andere namen en dan zal het wel werken.
Lees je de posts wel door?
Er staat zo veel in dat ik ook niet weet welke ik mag en niet mag veranderen
in het script
ik heb zo maar een stuk gepakt welke van day mag ik veranderen in dag?
Als ik dat weet dan zal het wel goed gaan denk ik.
Sorry
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?
$day = param("day" . $week_day);
$month = param("month" . $week_day);
$year = param("year" . $week_day);
$text = trim(param("text" . $week_day));
$Select = "select count(id) from " . $TableName . " where day = " . $day .
" and month = " . $month .
" and year = " . $year;
if (!$entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if (!$entry = mysql_fetch_array($entries)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if($entry[0] < 1)
{
if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
?>
$day = param("day" . $week_day);
$month = param("month" . $week_day);
$year = param("year" . $week_day);
$text = trim(param("text" . $week_day));
$Select = "select count(id) from " . $TableName . " where day = " . $day .
" and month = " . $month .
" and year = " . $year;
if (!$entries = mysql_query ($Select)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if (!$entry = mysql_fetch_array($entries)) {
trigger_error (mysql_error ());
echo '<pre>' . print_r (htmlentities ($sql), true) . '</pre>';
}
if($entry[0] < 1)
{
if($text != "")
{
$Insert = "insert into " . $TableName . " (text, day, month, year) values ('" . $text . "', " .
$day . ", " . $month . ", " . $year . ")";
//If there is no entry in the table for that day, create it.
?>
In ALLE sql dingen. Dus in alle query's. Dus in alle SELECT, UPDATE en INSERT dingen.
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -
dat script is echt rommel.
Maar wel bedankt nog.