TinyPortal

Development => Support => Topic started by: richie on September 22, 2009, 11:08:21 AM

Title: Database Error
Post by: richie on September 22, 2009, 11:08:21 AM
I have received this after inputing the code for the more portals, etc.

Database 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 ')
AND t.ID_BOARD=b.ID_BOARD
AND 1
ORDER BY t.ID_FIRST_MSG DESC
LIMIT' at line 3
File: /mnt/w0900/d19/s13/b02eba95/www/digitalspot.net/Sources/TPmodules.php
Line: 1719

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.10, while your database is at version 1.1.9. The above error might possibly go away if you execute the latest version of upgrade.php.
Title: Re: Database Error
Post by: G6Cad on September 22, 2009, 11:35:10 AM
Inputting what code to where ? More portals is what ?
Please add more info on what you have done.
Title: Re: Database Error
Post by: richie on September 22, 2009, 07:40:05 PM
Sorry I had to leave when I had to type this.  But on topic, this post.
http://www.tinyportal.net/index.php/topic,13069.msg125356.html#msg125356 (http://www.tinyportal.net/index.php/topic,13069.msg125356.html#msg125356)
http://www.tinyportal.net/index.php/topic,13069.msg125356.html#msg125356 (http://www.tinyportal.net/index.php/topic,13069.msg125356.html#msg125356)

Then when I chose my forums, once I got to the 7th for adding it so it can come on the portal it showed the error.
Title: Re: Database Error
Post by: G6Cad on September 22, 2009, 07:42:04 PM
In the bottom of that post JP Denis say you have to add the code i posted before her code ( the post you linked to )  Did you add the code i showed aswell ?
Title: Re: Database Error
Post by: richie on September 22, 2009, 07:47:04 PM
Yes I did.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 08:05:37 PM
It would probably be best if you posted the code you used so we're all on the same page. Unfortunately, the error message doesn't help because the error is always just before the text that they give you.
Title: Re: Database Error
Post by: richie on September 22, 2009, 08:31:24 PM
That error occurred once I was setting the portals.

Here is the code I used:
TPortalAdmin.template.php
echo '
// board 6
echo '
<select size="1" name="tp_ssiboard6"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board6'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
// board 7
echo '
<select size="1" name="tp_ssiboard7"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board7'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
// board 8
echo '
<select size="1" name="tp_ssiboard8"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board8'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
// board 9
echo '
<select size="1" name="tp_ssiboard9"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board9'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
//board 10
echo '
<select size="1" name="tp_ssiboard10"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board10'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '


TPortalAdmin.php
elseif($what=='tp_ssiboard1')
{
$bo=array();
$bo[0]=$_POST['tp_ssiboard1'];
$bo[1]=$_POST['tp_ssiboard2'];
$bo[2]=$_POST['tp_ssiboard3'];
$bo[3]=$_POST['tp_ssiboard4'];
$bo[4]=$_POST['tp_ssiboard5'];
$bo[5]=$_POST['tp_ssiboard6'];
$bo[6]=$_POST['tp_ssiboard7'];
$bo[7]=$_POST['tp_ssiboard8'];
$bo[8]=$_POST['tp_ssiboard9'];
$bo[9]=$_POST['tp_ssiboard10'];


G6 Post
// divide the SSI board into 5 boards
$sib=explode(',',$context['TPortal']['SSI_board']);
for($i=0 ; $i<10 ; $i++)
{
if(isset($sib[$i]))
$context['TPortal']['SSI_board'.($i+1)]=$sib[$i];
else
$context['TPortal']['SSI_board'.($i+1)]='';
}


Now this is exactly how I put it.

So thats what I did first.  These errors comes up right after choosing forum for portals.

Front index
QuoteYou 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 t.ID_BOARD=b.ID_BOARD
AND 1
ORDER BY t.ID_FIRST_MSG DESC
LIMIT' at line 3
File: /mnt/w0900/d19/s13/b02eba95/www/digitalspot.net/Sources/TPmodules.php
Line: 1719

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.10, while your database is at version 1.1.9. The above error might possibly go away if you execute the latest version of upgrade.php.

This is what appears on line 1719.
QuoteLIMIT $start, $limit", __FILE__, __LINE__);

Admin Panel
QuoteTable 'd60626144.modules' doesn't exist
File: /mnt/w0900/d19/s13/b02eba95/www/digitalspot.net/Sources/TPSubs.php
Line: 108

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.10, while your database is at version 1.1.9. The above error might possibly go away if you execute the latest version of upgrade.php.

This what appears on line 108.
Quote$request =  tp_query("SELECT permissions FROM " . $tp_prefix . "modules WHERE active=1", __FILE__, __LINE__);
Title: Re: Database Error
Post by: G6Cad on September 22, 2009, 08:41:09 PM
Link to your iste and also, please add in what SMF and TP version you use
Title: Re: Database Error
Post by: richie on September 22, 2009, 08:42:59 PM
www.digitalspot.net (http://www.digitalspot.net)

SMF v1.1.10 and the highest version of tinyportal 1084 beta 4 I think
Title: Re: Database Error
Post by: G6Cad on September 22, 2009, 08:52:29 PM
That might be the reason for the error right there, The code from the post were for TP V0983, im not 100% sure it works with Beta4. will have to let IchBin or Deni reply to that.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 09:10:25 PM
Okay. I see it. I think. :)

Look in TPSubs.php. Start with line 108 and go up until you come to a line that starts with the word global. Look in that line and see if it includes $tp_prefix. If it doesn't, add it, being sure to add a comma so that all the items there are in a list. (Rather like regular grammar.) Be sure the line ends with a semi-colon -- ;

If you come to a line that starts with function before you find one that starts with global, you'll need to add a line --


global $tp_prefix;


I don't know that this will fix everything, but it should take care of the "Table 'd60626144.modules' doesn't exist" problem.
Title: Re: Database Error
Post by: richie on September 22, 2009, 09:18:25 PM
Nope did not work.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 09:20:21 PM
What did you do?


Edited to add:
I'll tell you what. Attach the files that you have edited to a post. Please do not zip them. Just attach the php files. I'll take a look at them and see if I can figure out what's going on.
Title: Re: Database Error
Post by: richie on September 22, 2009, 09:22:38 PM
What you told me to do, I used the search in Expression and found some that did have the "If you come to a line that starts with function before you find one that starts with global, you'll need to add a line --"
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 09:24:49 PM
Attach your php files so I can take a look at them.
Title: Re: Database Error
Post by: richie on September 22, 2009, 09:27:16 PM
Which ones?
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 09:32:04 PM
The ones you've edited.
Title: Re: Database Error
Post by: richie on September 22, 2009, 09:39:52 PM
Here you go.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 09:41:28 PM
As I wrote before:

QuoteI'll tell you what. Attach the files that you have edited to a post. Please do not zip them. Just attach the php files. I'll take a look at them and see if I can figure out what's going on.

It's too much work for me to download them and unzip them. Please attach the php files.
Title: Re: Database Error
Post by: richie on September 22, 2009, 09:46:37 PM
Alright there you go.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 10:10:03 PM
I really don't know. It would probably be best for you to replace those files with the ones from the original distribution to get rid of your edits and get back to where you know it will work. It does appear that your version may need some different code than the previous version. Since it was 2 and a half years ago that I wrote the post in question, I've forgotten all about it and it would likely take me several days to figure it all out again.
Title: Re: Database Error
Post by: richie on September 22, 2009, 10:15:46 PM
Well I would be happy to go TP Beta Version 2.0 if it has more portals to add.
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 10:19:42 PM
TP Beta Version 2.0 does not exist.
Title: Re: Database Error
Post by: richie on September 22, 2009, 10:22:48 PM
http://www.familjegodis.se/smf2/
Title: Re: Database Error
Post by: G6Cad on September 22, 2009, 10:24:40 PM
Thats an alpha release and a very early one to, not for public release.
Title: Re: Database Error
Post by: richie on September 22, 2009, 10:27:21 PM
Oh well I really need something to handle 10 news.  I will not use Joomla or something like that.  I will stick with something that was made for SMF.
Title: Re: Database Error
Post by: ZarPrime on September 22, 2009, 10:27:38 PM
JPDeni,

I did this exact thing for a member a couple of weeks ago and it worked fine on TP 1.0 beta 4.  I attached the 2 files that would give them 15 News Boards to choose from.  I know it works because I made the edits to my test Forum as well.  The link to my post is here if it will help ...
http://www.tinyportal.net/index.php/topic,30689.msg245121.html#msg245121

ZarPrime
Title: Re: Database Error
Post by: richie on September 22, 2009, 10:37:08 PM
Dude I wished this work but it didn't. :(
Title: Re: Database Error
Post by: JPDeni on September 22, 2009, 10:42:31 PM
Well, if the files the ZP created for someone else worked for them but not for you, richie, then there is something else wrong with your setup and it's not a problem with this code.

I would suggest that you replace all of your TP files to get TP back to normal and test your site. Then you can try working with other things.