PDA

View Full Version : showthread // postbit : SQL Query


Harmachis
01-03-2009, 10:55 AM
Hi, im trying to creat a mod but i need some help in SQL Query.

at SHOWTHREAD & POSTBIT templete i saw these codes:

$post[avatarurl] = for user's avatar url

$post[musername] = shows poster name

$post[message] = shows posted message

now i need to add this codes in my new created PHP file (mod)
but what they r referring ? referring to which SQL code ?

well, i searched in showthread.php file but found nothing like those code :rolleyes:

now, can u provide me those SQL code, maybe like $post[message] = $db->query_read(" ...... which will work for the thread i want to read (myMod.php?t=threadid)

tnx in advance:)

Lynne
01-03-2009, 04:10 PM
Did you look at the big huge query around line 989 in showthread.php?

Harmachis
01-04-2009, 05:13 AM
u mean the codes under ###### SHOW THREAD IN LINEAR MODE ##### or $posts=
i tried them....i also added functions_bigthree.php & class_postbit.php in require_once

but it shows MySQL error when i tried to open the PHP file

Lynne
01-04-2009, 02:58 PM
And what is the mysql error? Just adding that code around where I mentioned is probably not enough. There is probably more code at the top of the page that also needs to get added.

Harmachis
01-05-2009, 03:19 AM
here's the error:
Database error
The Forums database has encountered a problem.

Please try the following:
Load the page again by clicking the Refresh button in your web browser.
Open the localhost home page, then try to open another page.
Click the Back button to try another link.
The localhost forum technical staff have been notified of the error, though you may contact them if the problem persists.

We apologise for any inconvenience.


well Lynne. can u plz provide me simple PHP code, which will work like showthread.php
i mean works those code $post[avatarurl], $post[musername], $post[message]
& works for any thread, like the code: t=$thread[threadid]

no need template code (html) just the PHP file's code.

tnx in advance :)

Lynne
01-05-2009, 03:42 PM
In order to see the database error, you need to View Page Source and then it will be at the bottom of the page source page.

I can't provide the code because I don't know it. I have no clue what you are doing and can only guide you to pieces of code that may help you out.