Forum Errors

Started by AMB, September 25, 2011, 06:02:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

#9
Well do something about it and find out why the querys falling AMB simple as that

Code (sql) Select

//=== get the stuff for just staff   if ($CURUSER['class'] >= UC_STAFF)   {   $res_poll_voted = sql_query('SELECT DISTINCT fpv.user_id, fpv.ip, fpv.added,                                  u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king, u.mood                                 FROM forum_poll_votes AS fpv                                 LEFT JOIN users AS u ON u.id = fpv.user_id                                 WHERE u.id > 0 AND poll_id = '.$arr['poll_id']);
            //=== let's see who's voted will add IP and time later            $who_voted = (mysql_num_rows($res_poll_voted) > 0 ? '<hr />' : 'no votes yet');            while ($arr_poll_voted = mysql_fetch_assoc($res_poll_voted))            {                $who_voted .= print_user_stuff($arr_poll_voted);              }   }


So thats the section - Do you have all the user table entries in ? Why can it be so hard to understand why a mysql query has failed, it can only be 2-3 things, the entrys missing on your db for the user table or the users missing like already mentioned.

Next is basic shit

Notice: Undefined variable: math_image in /var/www/forums/view_topic.php on line 207

Notice: Undefined variable: math_text in /var/www/forums/view_topic.php on line 208

Code (php) Select
$colour = $class = $attachments = $members_votes = $status = $topic_poll = '';

To

Code (php) Select
$colour = $class = $attachments = $members_votes = $status = $math_image = $math_text = $topic_poll = '';

Thats how to fix any undefined variables.. define them - Now go and work it out why that querys failed its a simple logical process like anything code related - You cannot expect to run to me when i cannot test v2 stuff anymore, that is obvious and not given a second thought, start using your heads and look at what you have in front of you, look at what its doing, look at what its querying.

Struggling on V2 aint going to help you in anyway trying to take on the next release which is even more complex.

AMB

Quote from: putyn on October 24, 2011, 08:51:01 AM
still having this error ?

Yes lol and i updated the view_topic.php with the update Mindless did :(

putyn

still having this error ?

Diablo999

AMB - Perhaps it's because of a deleted user, who voted in the poll of that threat.
I've seen this error cause of a deleted user who has a post in the thread.
If dump the post in recycle, then the error dissapears for classes below staff and staff still gets that error since they can see the post.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wwwchild/public_html/forums/view_topic.php on line 415

AMB

I got a new error.. I did what putyn said to do and nothing came up.. I tried my best on trying to figure this one out myself, but no can do.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/forums/view_topic.php on line 110

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/forums/view_topic.php on line 111

Warning: Cannot modify header information - headers already sent by (output started at /var/www/forums/view_topic.php:110) in /var/www/templates/5/template.php on line 40

AMB

This is the error i got in the error log

Date: Thu, 29 Sep 2011 15:39:16 +0100
Error Number: 1064
Error: 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 '' at line 1
IP Address:
in file /var/www/forums/view_topic.php on line 409
URL:/forums.php?action=view_topic&topic_id=43&page=last
Username: AMB[1]

Mindless

#3
Moving from nginx to Apache is horses for courses, makes no odds codes built on Apache, debugged on Apache so that's just coincidence, like putyn says the query's fucked.

putyn

you have problems with a query - look in view_topic to see what query its used as a resource for mysql_fetch_assoc on line 112 after you locate the query add an sqlerr(__FILE__,__LINE__) at the end and look for the mysql error in the mysql error log

AMB

Hey all,

This all started when i switched over from nginx to Apache..
Getting alot of errors and i don't know why to be honest. Was working fine, but now error city :(



Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/forums/view_topic.php on line 111

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/forums/view_topic.php on line 112

Notice: Undefined variable: math_image in /var/www/forums/view_topic.php on line 207

Notice: Undefined variable: math_text in /var/www/forums/view_topic.php on line 208

Notice: Undefined variable: math_image in /var/www/forums/view_topic.php on line 207

Notice: Undefined variable: math_text in /var/www/forums/view_topic.php on line 208

Notice: Undefined variable: math_image in /var/www/forums/view_topic.php on line 207

Notice: Undefined variable: math_text in /var/www/forums/view_topic.php on line 208

Warning: Cannot modify header information - headers already sent by (output started at /var/www/forums/view_topic.php:111) in /var/www/templates/5/template.php on line 40