Previous Thread
Next Thread
Print Thread
Rate Thread
#263322 11/23/2003 8:42 AM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
(ubbthreads 6.3.2)

I my all mysql logs on the forum I have this lines:
[]
Unable to do_query: SELECT B_Main, B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating,B_Board FROM w3t_Posts WHERE B_Number = - 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 3
[/]

In showthreaded.php (where is this error):

[]
// -----------------------------------------
// Grab the main post number for this thread
$query = "
SELECT B_Main, B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating,B_Board
FROM {$config['tbprefix']}Posts
WHERE B_Number = $Number
";
$sth = $dbh -> do_query($query);
list ($current,$posted,$tsubject,$Rating,$Rates,$stars,$Board) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);
[/]

and WHERE B_Number = $Number <-this is line 3...

Quetions is: what is wrong in line 3 ?

Sponsored Links
Dawg_dup1 #263323 11/23/2003 10:28 AM
Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
The var $Number is empty.

mcse007 #263324 11/24/2003 12:01 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
ok... so how can I correct this?

Dawg_dup1 #263325 11/25/2003 8:54 AM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
That happends if someone clicks on a link that doesnt contain a the &Number parameter.
What version are you using? The current version should fetch this error.

Simply insert something like this:
// ----------------------------------------------------
// If we don't have a post number then we can't view it
if (!$Number) {
$html -> not_right($ubbt_lang['POST_PROB'],$Cat);
}

after this line:
$html = new html;

-Fusion- #263326 11/26/2003 2:49 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
thx. I'm useing 6.3.2

Sponsored Links
Dawg_dup1 #263327 11/26/2003 2:55 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
6.3.2 should have this check already included. So it must be something else that causes this error.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)