Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 12 Jul 2010, 11:18
Przemoo Przemoo is offline
 
Join Date: Jun 2010
Records from database

Hi.

What code is responsible for displaying all the records from the database / table
Is there any other method than "echo"
Reply With Quote
  #2  
Old 12 Jul 2010, 16:06
Speysider's Avatar
Speysider Speysider is offline
 
Join Date: Apr 2009
Just use the SELECT query and use $row['(name of row here)'] in a table tag.
__________________
vBulletin is down the drain. IB ruined it by attacking XenForo.
I am a MyBB and XF modder only.
Reply With Quote
  #3  
Old 12 Jul 2010, 16:25
Przemoo Przemoo is offline
 
Join Date: Jun 2010
what is wrong in that code ?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it shows me only the last entry in the table instead of all
Reply With Quote
  #4  
Old 12 Jul 2010, 16:31
Speysider's Avatar
Speysider Speysider is offline
 
Join Date: Apr 2009
try a do ... while loop, instead of just a while loop
__________________
vBulletin is down the drain. IB ruined it by attacking XenForo.
I am a MyBB and XF modder only.
Reply With Quote
  #5  
Old 12 Jul 2010, 16:36
Przemoo Przemoo is offline
 
Join Date: Jun 2010
what do u mean exactly ? could u change that for me please ?
Reply With Quote
  #6  
Old 12 Jul 2010, 16:50
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by Przemoo View Post
what do u mean exactly ? could u change that for me please ?
The do... while loop is below... not sure if it will help personally but this is how you do it.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #7  
Old 12 Jul 2010, 17:11
Przemoo Przemoo is offline
 
Join Date: Jun 2010
still shows the last entry

i think the problem is here

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but i don't know what exactly ;/
Reply With Quote
  #8  
Old 12 Jul 2010, 17:28
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Why don't you echo x; at some point so you can see how many rows there are supposed to be in the loop, that would help pinpoint the issue... if x=1 then the problem is with the sql, otherwise the sql is probably right,
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #9  
Old 12 Jul 2010, 23:17
Przemoo Przemoo is offline
 
Join Date: Jun 2010
could u write an example code for templates ? what code should be there :>
Reply With Quote
  #10  
Old 12 Jul 2010, 23:24
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
after your while loop just put the line:

echo "<h1>" . $x . "</h1>" ;

That should output the value of x somewhere in a big font, just for debugging purposes, obviously don't run your forum this way. I don't know if $x is available in a template... just put:
<h1>$x</h1>
somewhere in the template and see if anything shows up.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #11  
Old 12 Jul 2010, 23:38
Przemoo Przemoo is offline
 
Join Date: Jun 2010
it show up but on the top only (take a look on a screen)
Attached Images
File Type: jpg 4j6hsk.jpg (59.0 KB, 4 views)
Reply With Quote
  #12  
Old 12 Jul 2010, 23:54
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
That's good, that means there are 4,668 rows in your variable- the SQL statement is right (probably) you just need to figure out how to print it. (Which I realize was your first question to start this thread, but at some point you questioned if the SQL statement was right).
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #13  
Old 13 Jul 2010, 11:40
Przemoo Przemoo is offline
 
Join Date: Jun 2010
its working now, because of $dane


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


but there is another problem with pagination
i used tha article - http://www.vbulletin.org/forum/showt...ght=Paginating

paginating shows up but only for few minutes and then disappeared


that how it is


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by Przemoo; 13 Jul 2010 at 14:08.
Reply With Quote
  #14  
Old 13 Jul 2010, 14:06
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I'm not sure how that's supposed to work. It looks like you're always starting at the first record instead of calculating " $limitlower " like in the article.

Also, I think you might want to go back to using a "while" loop instead of "do...while", because I think the way you have it you're using the "$row" variable the first time before you've set it.

BTW, you probably don't want to post your database connect info. Is there a reason you're opening a database connection instead of using the one vB opens?
Reply With Quote
  #15  
Old 13 Jul 2010, 14:12
Przemoo Przemoo is offline
 
Join Date: Jun 2010
Originally Posted by kh99 View Post
I'm not sure how that's supposed to work. It looks like you're always starting at the first record instead of calculating " $limitlower " like in the article.

Also, I think you might want to go back to using a "while" loop instead of "do...while", because I think the way you have it you're using the "$row" variable the first time before you've set it.

BTW, you probably don't want to post your database connect info. Is there a reason you're opening a database connection instead of using the one vB opens?
omg i forgot to hide it ;p thx

my hosting is sux, i've got limit in "max_user_connection" and my script doesn't close the connection thats why am using VPS for that.
pagenav was working yesterday i don't know why is not :/
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:57.

Layout Options | Width: Wide Color: