Warning: mysql_numrows
Hi
Bin mal wieder ein neues Projekt bauen...
Ich bekomme diesen Fehler.
Hat jemand einen Plan wie ich das wegbekomme?
http://www.rezepte-zubereiten.de/cocktai…genum=0&catid=1
Bin mal wieder ein neues Projekt bauen...
Ich bekomme diesen Fehler.
Hat jemand einen Plan wie ich das wegbekomme?
http://www.rezepte-zubereiten.de/cocktai…genum=0&catid=1
Zitat
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/kunde0409/html/kochen/rezeptdatenbank/cocktail/category.php on line 25
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/kunde0409/html/kochen/rezeptdatenbank/cocktail/category.php on line 49
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
|
|
PHP-Quelltext |
1 |
echo mysql_error();
|
schreib das mal unter zeile 25 und zeile 49, dann können wir weitersehen...
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Hi
Danke das Du mir hilfst..
Das kommt dabei raus:
Danke das Du mir hilfst.. Das kommt dabei raus:
Zitat
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/kunde0409/html/kochen/rezeptdatenbank/cocktail/category.php on line 25
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 status = 'L'' at line 1You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/kunde0409/html/kochen/rezeptdatenbank/cocktail/category.php on line 52
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
gut, dann brauchen wir jetzt noch die zeilen 25 und 49 
wie der Fehlermeldung entnehmen kannst, hast du einen Syntax error in deiner MySQL Syntax...
die Position steht auch ungefähr dabei, jetzt müssen wir mal gucken was es genau ist...

wie der Fehlermeldung entnehmen kannst, hast du einen Syntax error in deiner MySQL Syntax...
die Position steht auch ungefähr dabei, jetzt müssen wir mal gucken was es genau ist...
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »heinervdm« (13. November 2005, 18:02)
Hier ab Zeile 24-57
|
|
PHP-Quelltext |
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 27 28 29 30 31 32 33 34 |
$result = mysql_query($sql ,$db);
$numrows = mysql_numrows($result);
echo mysql_error();
$lastpage = false;
if ($pagenum == 0) {
$startrow = 0;
} else {
$startrow = 25 * $pagenum;
}
if ($numrows < $startrow + 25) {
$endrow = $numrows;
$lastpage = true;
}
if ($letter) {
$sql = "select drinkid, title, date, rating from drinks where title like '$letter%' and status = 'L' order by title limit $startrow,25";
$pagetitle = "Drinks starting in the letter '$letter'";
} else {
$sql = "select * from categories where categoryid = $catid";
$result = mysql_query($sql ,$db);
echo mysql_error();
$row = mysql_fetch_row($result);
$pagetitle = $row[1];
$sql = "select drinkid, title, date, rating from drinks where categoryid = $catid and status = 'L' order by title limit $startrow,25";
}
|
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
|
|
PHP-Quelltext |
1 |
$sql = "select * from categories where categoryid = '".$catid."'";
|
das sollte dir bei zeile 49 helfen, der query für zeile 25 ist bei dir noch vor zeile 25...
also den müsstest du mir dann auch noch zeigen
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Das ist 1-25
|
|
PHP-Quelltext |
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 |
<?php include("rheader.php"); ?>
<?php
$letter = $_REQUEST['letter'];
$numeric = $_REQUEST['numeric'];
if ($letter) {
$sql = "select drinkid, title, date, rating from drinks where title like '$letter%' and status = 'L'";
} else {
$sql = "select drinkid, title, date, rating from drinks where categoryid = $catid and status = 'L'";
}
if ($numeric == "all") {
$sql = "select drinkid, title, date, rating from drinks where title REGEXP '^[1234567890]' and status = 'L'";
}
$result = mysql_query($sql ,$db);
$numrows = mysql_numrows($result);
|
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
da ist es nochmal genau das gleiche:
|
|
PHP-Quelltext |
1 |
$sql = "select drinkid, title, date, rating from drinks where categoryid = '".$catid."' and status = 'L'";
|
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Klasse das ist weg...
Ist nur noch das hier
Zeile 91-107
Ist nur noch das hier
Zitat
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/kunde0409/html/kochen/rezeptdatenbank/cocktail/category.php on line 97
Zeile 91-107
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php
$rowcolor = 1;
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
if ($rowcolor == 1) {
$rowcolorhex = "#ffffff";
$rowcolor = 0;
} else {
$rowcolorhex = "#EDEAB9";
$rowcolor = 1;
}
|
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
da fehlt wieder der query
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Ich weis nicht wo der sitzt...
Hab jetzt mal die ganze Datei
Hab jetzt mal die ganze Datei
|
|
PHP-Quelltext |
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
<?php
$letter = $_REQUEST['letter'];
$numeric = $_REQUEST['numeric'];
if ($letter) {
$sql = "select drinkid, title, date, rating from drinks where title like '$letter%' and status = 'L'";
} else {
$sql = "select drinkid, title, date, rating from drinks where categoryid = '".$catid."' and status = 'L'";
}
if ($numeric == "all") {
$sql = "select drinkid, title, date, rating from drinks where title REGEXP '^[1234567890]' and status = 'L'";
}
$result = mysql_query($sql ,$db);
$numrows = mysql_numrows($result);
echo mysql_error();
$lastpage = false;
if ($pagenum == 0) {
$startrow = 0;
} else {
$startrow = 25 * $pagenum;
}
if ($numrows < $startrow + 25) {
$endrow = $numrows;
$lastpage = true;
}
if ($letter) {
$sql = "select drinkid, title, date, rating from drinks where title like '$letter%' and status = 'L' order by title limit $startrow,25";
$pagetitle = "Drinks starting in the letter '$letter'";
} else {
$sql = "select * from categories where categoryid = '".$catid."'";
$result = mysql_query($sql ,$db);
echo mysql_error();
$row = mysql_fetch_row($result);
$pagetitle = $row[1];
$sql = "select drinkid, title, date, rating from drinks where categoryid = $catid and status = 'L' order by title limit $startrow,25";
}
if ($numeric == "all") {
$sql = "select drinkid, title, date, rating from drinks where title REGEXP '^[1234567890]' and status = 'L' order by title limit $startrow,25";
$pagetitle = "Drinks starting in numbers";
}
?>
<TD VALIGN=top width="60%" BGCOLOR="FFFFFF">
<TABLE BORDER=0 WIDTH=99% ALIGN=CENTER>
<TR>
<TD VALIGN=top>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% BGCOLOR=000000>
<TR><TD align=center><FONT SIZE=2 FACE="Verdana,arial,helvetica" color=white><B><?php printf($pagetitle); ?></B></FONT></TD></tR>
</TABLE>
<FONT SIZE=2>
<center>
<br>
<table cellspacing=0 cellpadding=2 border=0>
<tr>
<th width=300 bgcolor=#CCCCCC align=center><FONT face=arial size=2>Drink</font></th>
<th width=85 bgcolor=#CCCCCC align=center><FONT face=arial size=2>Date Added</font></th>
<th width=75 bgcolor=#CCCCCC align=center><FONT face=arial size=2>Rating</font></th>
</tr>
<?php
$rowcolor = 1;
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
if ($rowcolor == 1) {
$rowcolorhex = "#ffffff";
$rowcolor = 0;
} else {
$rowcolorhex = "#EDEAB9";
$rowcolor = 1;
}
printf("<tr>");
printf("<td width=300 bgcolor=%s align=center><FONT face=arial size=2><a href=drink.php?drinkid=%s>%s</a></font></td>", $rowcolorhex, $myrow["drinkid"], $myrow["title"]);
printf("<td width=80 bgcolor=%s align=center><FONT face=arial size=2>%s</font></td>", $rowcolorhex, $myrow["date"]);
printf("<td width=75 bgcolor=%s><table bgcolor=%s border=0 cellspacing=0 cellpadding=0><tr>", $rowcolorhex, $rowcolorhex);
$onstars = round($myrow["rating"]);
$offstars = 5 - $onstars;
for ($i = 1; $i <= $onstars; $i++) {
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staron2.gif></font></td>", $rowcolorhex);
}
for ($f = 1; $f <= $offstars; $f++) {
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staroff2.gif></font></td>", $rowcolorhex);
}
printf("</tr></table></td>");
printf("</tr>");
} while ($myrow = mysql_fetch_array($result));
}
printf("<tr>");
if ($startrow > 0) {
printf("<td align=left><FONT face=arial size=2><a href=category.php?pagenum=%s&searchingred=%s&catid=%s&letter=%s>Previous Page</a></font></td>", $pagenum-1, $searchingred, $catid, $letter);
} else {
printf("<td> </td>");
}
printf("<td> </td>");
if ($lastpage == false) {
printf("<td align=left><FONT face=arial size=2><a href=category.php?pagenum=%s&searchingred=%s&catid=%s&letter=%s>Next Page</a></font></td>", $pagenum+1, $searchingred, $catid, $letter);
} else {
printf("<td> </td>");
}
printf("</tr>");
?>
|
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Reiner« (13. November 2005, 19:44)
zeile 53:
|
|
PHP-Quelltext |
1 |
$sql = "select drinkid, title, date, rating from drinks where categoryid = '".$catid."' and status = 'L' order by title limit $startrow,25";
|
Über mich: www.heinervdm.de
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Persönlich Mitteilungen an mich bitte als PN (nicht Email) hier im Forum. ICQ und Skype bitte nur in Notfällen.
Danke..
Der Fehler ist zwar weg, aber auch kein Cocktail da..
http://www.rezepte-zubereiten.de/cocktai…enum=0&catid=44
Nachtrag
Komisch ist nur das das gleiche Script auf Funpic prima läuft..
http://kochforum.ko.funpic.de/cocktail/
Liegt das an Severeinstellungen?
Kann ich was daran Ändern?
Habs rausgefunden...
Dies eingefügt und es funzt alles
Der Fehler ist zwar weg, aber auch kein Cocktail da..
http://www.rezepte-zubereiten.de/cocktai…enum=0&catid=44
Nachtrag
Komisch ist nur das das gleiche Script auf Funpic prima läuft..
http://kochforum.ko.funpic.de/cocktail/
Liegt das an Severeinstellungen?
Kann ich was daran Ändern?
Habs rausgefunden...
Dies eingefügt und es funzt alles
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 |
// alle GET, POST und COOKIE wegen Globals_off parsen
// $types_to_register = array('GET','COOKIE','POST','SERVER','FILES','ENV','SESSION','REQUEST');
$types_to_register = array('GET','POST','SERVER','SESSION');
foreach ($types_to_register as $global_type) {
$arr = @${'HTTP_'.$global_type.'_VARS'};
if (@count($arr) > 0) extract($arr, EXTR_OVERWRITE);
else {
$arr = @${'_'.$global_type};
if (@count($arr) > 0) extract($arr, EXTR_OVERWRITE);
}
}
|
Servus
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Reiner
http://www.webspace-domain-server.de
http://www.webdesign-computer.de/shop/
http://www.tickets-und-eintrittskarten.de
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Reiner« (15. November 2005, 09:05)


