| Author |
Message |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Sun Dec 21, 2003 10:26 am |
  |
Hi all,
I have a form that adds several items to a table and stores the info in a database.
I would like a block on my main page that will display the latest ten items of this table.
I cannot program in php or sql.
Can someone still tell me how to accomplish this or are there scripts that will do this for me? |
|
|
   |
 |
RedGerry
Captain


Joined: Jul 28, 2003
Posts: 304
Location: Alloa, Scotland
|
Posted:
Sun Dec 21, 2003 5:38 pm |
  |
If you give me the table name, field names and what you want displayed I'll post the code for you.. |
_________________ RedGerry.com - Home of RG_Sports |
|
      |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Mon Dec 22, 2003 12:52 am |
  |
|
   |
 |
gschoper
Captain


Joined: Sep 16, 2003
Posts: 380
|
Posted:
Mon Dec 22, 2003 1:11 am |
  |
Can you post the database table name and field names, it would make it easier.
gschoper |
_________________
http://nuke.schoper.net/ |
|
     |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Mon Dec 22, 2003 1:45 am |
  |
Sure,
The table name is: "divx"
The field names are:
"Divx Title" "Download Location", "Language", "Name Author" "E-mail" and "Date Added". |
|
|
   |
 |
RedGerry
Captain


Joined: Jul 28, 2003
Posts: 304
Location: Alloa, Scotland
|
Posted:
Mon Dec 22, 2003 5:52 am |
  |
Right you want top 10? by what...?
I've written two blocks for my RG_Sports module that can be seen on the right hand side about half way down - top players and top clubs
http://www.scottishwomensfootball.co.uk
These are using a field 'counter' to sort, are you sure about the above field names, spaces in field names are a pain... |
_________________ RedGerry.com - Home of RG_Sports |
|
      |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Mon Dec 22, 2003 6:01 am |
  |
Hi,
Only E-mail should be E Mail |
|
|
   |
 |
Lirpa
Nuke Cadet


Joined: Dec 22, 2003
Posts: 4
|
Posted:
Mon Dec 22, 2003 6:33 am |
  |
| RedGerry wrote: |
Right you want top 10? by what...?
I've written two blocks for my RG_Sports module that can be seen on the right hand side about half way down - top players and top clubs
http://www.scottishwomensfootball.co.uk
These are using a field 'counter' to sort, are you sure about the above field names, spaces in field names are a pain... |
Hi, where can I get this block from? |
|
|
   |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Mon Dec 22, 2003 8:27 am |
  |
Like I explained, I would like the last ten added items to a table,
shown in a custom block or just on my main page, in the center. |
|
|
   |
 |
RedGerry
Captain


Joined: Jul 28, 2003
Posts: 304
Location: Alloa, Scotland
|
Posted:
Tue Dec 23, 2003 4:24 am |
  |
ok.. give me your email (by PM) and I'll send it over to you later today. Midday here in Scotland and am off to get the last of my Christmas shopping done... |
_________________ RedGerry.com - Home of RG_Sports |
|
      |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Tue Dec 23, 2003 5:07 am |
  |
Take your time man, many thnx
I'll pm you |
|
|
   |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Tue Dec 23, 2003 4:54 pm |
  |
Does anybody else know how to make this work? |
|
|
   |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Thu Dec 25, 2003 3:18 am |
  |
|
   |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Thu Dec 25, 2003 3:50 pm |
  |
K guys, since I got no reply up til now, I decided to give it a try myself.
this is the code I'm using:
| Code: |
<?php
$xvid='xvid';
$conn = mysql_connect("localhost", "username", "pass")
or die("failed to connect: " . mysql_error());
mysql_select_db("xvid")
or die("failed to select database: ".mysql_error());
$query = SELECT Xvid_Title FROM xvid ORDER by Language DESC limit 10;
//return $query;
$result=mysql_query($query);
?> |
Can someone tell me what's wrong with it?
Secondly:
How can I display the values it gets from my table on a page? |
|
|
   |
 |
Tjendol
Sergeant


Joined: Dec 15, 2003
Posts: 77
|
Posted:
Wed Dec 31, 2003 2:49 am |
  |
|
   |
 |
|
|