The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Columnizing
I've NO idea what I am doing wrong here.
PHP Code:
PHP Code:
NOTE: I cut out the template name and query because they aren't really relevant they both work perfectly and this is a snippet of the overal code the rest of it isn't relevant to this part (or even executed yet) hence why I haven't posted it. |
#2
|
|||
|
|||
There is a closing curly brace (}) missing from your while() statement. Also you don't need the single quotes around the 3 in [minicode]$columncount = '3';[/minicode]. Run
PHP Code:
Maybe check that you are getting results from the database first. |
#3
|
||||
|
||||
The query is working fine, its returning all 4 records from the database with errors and the counter is working fine as I've put $counter in the template and its clearly stating 1-3 then resets to 1 without adding the </tr><tr> on 3.
See attached picture. Its returning the names, the descriptions and the counter. |
#4
|
|||
|
|||
Well if you are using templates you can't echo or print anything but what you can do is something like this.
PHP Code:
|
#5
|
||||
|
||||
Oh wow, that works. Thanks!
Question: what does the . in .= do? |
#6
|
||||
|
||||
Concatenate
Google it. |
#7
|
|||
|
|||
Always check the HTML source of the output when you're using PHP and things do go to plan. Sometimes the browser hides incorrectly placed code so you don't always see the exact output. It probably would have shown you your error.
|
#8
|
||||
|
||||
It didn't output the </tr><tr> at all I put <!-- cat --> at the top and <!-- / cat --> at the bottom of the template to check if it was being outputted but in the wrong place. And It wasn't. But its working nicely now so thats all that matters. :up:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|