Cookie Policy: This web site uses cookies. By using this site you agree to our cookie policy.
Disclaimer: By posting on this web site it is accepted that you have agreed to the T&C. This is an information forum, and it is just that information, all views are of the individual poster and not that of the site owner. Please DO NOT publish copyrighted material without the owners permission. If you copy news or articles include a link back to the original site. Threads/Posts may be deleted on request. No other links without permission.
BEFORE POSTING A QUESTION: Your question has probably been asked before, so please use the
SEARCH FUNCTION, as we grow tired of answering the same question again and again.
Results 1 to 7 of 7

Thread: Anyone good at WML ?

  1. #1

    Join Date
    May 2006
    Location
    London
    Posts
    546
    Rep Power
    36

    Anyone good at WML ?

    Hi there everyone

    I have a database with 15 tables in my database format
    address ccn expirydate securitycode amount

    I would like to display a table that will name all 15 tables and the sum of amount
    so eg

    table 1 456
    table 2 465
    table 3 987
    .
    .
    table 15 432

    I think it might be like SELECT * TABLES, SUM(amount); ORDER TABLES

    any ideas ?

    How would i use php to display it like that
    I have this already and it doesnt work

    Code:
    <?PHP
    
     mysql_pconnect('localhost','admin','admin');
    
    mysql_select_db("wml");
    
       $results = mysql_query("SELECT * TABLES, SUM(amount); ORDER TABLES");
    
       if ($results){
    
           while ($a = mysql_fetch_array($results)) {
    
            echo'<TABLE><TR>
                  <TD>'.$a['name'].'</TD>
                  <TD>'.$a['amount'].'</TD>
    	     </TR></TABLE>';
           };
    
           print("</TABLE>");
    
           } else {
    
           print("No results to display");
    
           };
    ?>

    any ideas ? thanks guys



  2. #2

    Join Date
    May 2006
    Location
    London
    Posts
    546
    Rep Power
    36

    Anyone good at php and sql ?

    .



  3. #3

    Join Date
    Feb 2002
    Location
    N Wales
    Posts
    50,310
    Rep Power
    275
    I can program in it yes, but having just got out of bed with my happy pill still working....waaaaaay too early to engage the brain in realism!! :)

    I'll look this afternoon.

    I know I'd write it different though, get the row count & use a For loop.

    FREE Live Odds Comparison Software

    Keith Driscoll - Administrator
    Managing Director, Win2Win Limited



    Filipino UK Filipino Forum | Win2Win Racing - Free Tips


  4. #4

    Join Date
    May 2006
    Location
    London
    Posts
    546
    Rep Power
    36
    Quote Originally Posted by Win2Win View Post
    I can program in it yes, but having just got out of bed with my happy pill still working....waaaaaay too early to engage the brain in realism!! :)

    I'll look this afternoon.

    I know I'd write it different though, get the row count & use a For loop.
    Id be so muc happier at christmas if this gets done by then, gotta be down kent for 3 days so no work till them :(



  5. #5

    Join Date
    Feb 2002
    Location
    N Wales
    Posts
    50,310
    Rep Power
    275
    Is your mysql_query calling the right data? As that is not the way I'd do it. Try calling it direct in myphpadmin & see if it gives the data out correctly.

    The way I do it is;

    HTML Code:
    	$query = "SELECT indexx,time,meeting,date,odds FROM `dbONE` ORDER BY indexx ASC"; 
    	$ans = mysql_query($query);

    FREE Live Odds Comparison Software

    Keith Driscoll - Administrator
    Managing Director, Win2Win Limited



    Filipino UK Filipino Forum | Win2Win Racing - Free Tips


  6. #6

    Join Date
    May 2006
    Location
    London
    Posts
    546
    Rep Power
    36
    Code:
     $results = mysql_query("SELECT * TABLES, SUM(amount); ORDER TABLES");
    Im trying to call that but i know its incorrect.

    Code:
    SELECT indexx,time,meeting,date,odds FROM `dbONE` ORDER BY indexx ASC";
    that would only give the columns for table dbONE.

    How do i get it to to display 15 table names and the SUM for column amount ?
    Im basically naming the table name and displaying sum of that column

    eg it might be

    dbONE 465
    dbTWO 465798
    dbTHREE 987798



  7. #7

    Join Date
    Feb 2002
    Location
    N Wales
    Posts
    50,310
    Rep Power
    275
    This explains better than me waffling on :D
    http://www.daniweb.com/forums/thread26446.html

    FREE Live Odds Comparison Software

    Keith Driscoll - Administrator
    Managing Director, Win2Win Limited



    Filipino UK Filipino Forum | Win2Win Racing - Free Tips


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. BBC - Something good.
    By Fadetoblack in forum Rant
    Replies: 8
    Last Post: 16th January 2008, 09:39
  2. good,good, good good vibrations
    By piggy in forum Humour Room
    Replies: 1
    Last Post: 23rd March 2006, 01:24
  3. Old but Good...
    By Merlin in forum Humour Room
    Replies: 0
    Last Post: 31st December 2005, 08:21
  4. Any good?
    By vegyjones in forum Humour Room
    Replies: 1
    Last Post: 6th December 2005, 03:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Free Tips | Betting Advice | UK Horse Racing Tips | Free Bets | Staking Advice | Horse Racing Systems | Horse Racing Lays | Laying System | UK Horse Racing Tips | lay betting