|
-
Apr 21st, 2002, 01:02 PM
#1
Thread Starter
Fanatic Member
another weird error
PHP Code:
$num = mysql_num_rows(mysql_query("SELECT * FROM reviews"));
//echo $num-5;
if(($num-5)<=0){
$sql = "SELECT * FROM reviews LIMIT $num";
}
else{
$sql = "SELECT * FROM reviews LIMIT $num-5, 5";
}
$result = mysql_query($sql);
while ($rrow = mysql_fetch_array($rresult)) {
printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>", $row['id'], $row['system'], $row['gamename']);
}
it gives an error on the "while" line...any ideas? my select is correct, because if i do "echo $num-5", itll return the correct number
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 02:18 PM
#2
Thread Starter
Fanatic Member
and
[code]Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 188
Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 189]/code]
its complaining about the <head> </head> portion of my thing, is there a way i can suppress those errors?
and is there a limit on the amount of text a textbox can handle?
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 02:59 PM
#3
Addicted Member
while ($rrow = mysql_fetch_array($rresult)) {
Could it be the double r ?
What is the answer to this question?
-
Apr 21st, 2002, 03:02 PM
#4
Thread Starter
Fanatic Member
actually what i did is i doubled the r's just incase that might have been the problem. guess i forgot to take that one out before posting it here.
still gives an error there though
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 04:04 PM
#5
Originally posted by nabeels786
and
[code]Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 188
Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 189]/code]
its complaining about the <head> </head> portion of my thing, is there a way i can suppress those errors?
and is there a limit on the amount of text a textbox can handle?
it is not complaining about your head tags. it is complainging that you sent the header out already and you are trying to do it again. you must have something outputting text to the browser before you did something. the cod eyou have tehre will not do that. itis something else in your code. even a space after <? will messit up. are you useing a header() function anywhere? are you using a cookie anywhere?
and why does everybody want to surpress the errors. if you get an error then your code will not run that is why the errors show up. duhhhhh!
there is no limit a textbox can handle.
it is getting an error because you got this
$result = mysql_query($sql);
while ($rrow = mysql_fetch_array($rresult)) {
where is $rresult it does not exist.
-
Apr 21st, 2002, 04:08 PM
#6
Thread Starter
Fanatic Member
i fixed up the double r's, still wont submit
that missing header - it still loads the page and does everything fine. that peice of code is sending out a header, but i cant stop it from doing that cuz the cookies are needed
the textbox thing - if i have text thats kinda long, and i click the submit button, it doesnt do anything. but if i take out a paragraph, then itll submit fine
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 04:13 PM
#7
you will have to check for cookie or set one before you out put the headers.
the text in the textbox is not your problem. what did you assign to the category you are submittin gto? text that has a limit to 255 but largetext I think will hold more. what is your cod enow as the one above should work.
-
Apr 21st, 2002, 04:19 PM
#8
Thread Starter
Fanatic Member
Yes, I have it set to largetext as the type in the table.
But when I click the submit button, nothing happens, but if i take some code out, then itll submit the code. if you want the whole php page, i can upload it
PHP Code:
$num = mysql_num_rows(mysql_query("SELECT * FROM reviews"));
//echo $num-5;
if(($num-5)<=0){
$sql = "SELECT * FROM reviews LIMIT $num";
}
else{
$sql = "SELECT * FROM reviews LIMIT $num-5, 5";
}
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>", $row['id'], $row['system'], $row['gamename']);
}
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 04:24 PM
#9
try this
PHP Code:
$num = mysql_num_rows(mysql_query("SELECT * FROM reviews"));
//echo $num-5;
if(($num-5)<=0){
$sql = "SELECT * FROM reviews LIMIT $num";
}
else{
$sql = "SELECT * FROM reviews LIMIT $num-5, 5";
}
$result = mysql_query($sql);
if (!$result){
echo mysql_error($result)
}
while ($row = mysql_fetch_array($result)) {
printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>", $row['id'], $row['system'], $row['gamename']);
}
I add ing our little frined the error checker. I suggest using it all the time as it will help you a lot for debugging. if you don't need to debug it them just comment it out.
and yes upload the page as thi spart will not stop you from submitting.
-
Apr 21st, 2002, 04:30 PM
#10
Thread Starter
Fanatic Member
wow, its working now. i dont know what the problem was, i just copied and pasted what you wrote.
weird
you can see it from here
http://fbgforums.jniv.net/reviews/index.php
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 21st, 2002, 04:40 PM
#11
that is why that little error checker is your friend. 
cool.
-
Apr 21st, 2002, 05:05 PM
#12
Thread Starter
Fanatic Member
im starting to like it more and more
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|