Jump to content

csabi_fl

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

csabi_fl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi everyone. I have a table in my database with the following fields:counter,loginid,password,email and country. I don't know how to set up the indexes for the proper table structure.I have set up 'loginid' to be unique,but what else? Please advise.Thank you.
  2. Hi. Here is my question.After running an SQL query on one of my tables in my database ,am I able to save the result of this query in another table?If so,how?
  3. The records are stored in HTML .What is the code to pull one row out of my table and display it?
  4. I have a table on one of my pages that stores the position number,login ID and score.For example one row looks like this: 20(position)|Mary|120(points) I want to output this particular row on another page,so when 'Mary" logs in she will have this row displayed.How do I do that?
  5. Hi guys. Please read my previous posts and help me out here.It is very URGENT.Thank you.
  6. I don't get it.I  changed the code like you said and it pulls one row out of the table,BUT the first column(counter) is 1 for every member.So I believe there is something wrong in the 'echo' statement.Could you take a look at that,please?
  7. [code]Please take a look at this code: [code<?php echo <<<_HTML <table cellpadding="5" cellspacing="0" border="1"> <tr> <td>No.</td><td>Login ID</td><td>Weeksum</td> </tr> _HTML; mysql_pconnect("localhost","",""); mysql_select_db(""); $query  = "SELECT loginid,SUM(week1+week2) AS weekSum FROM submit1 GROUP BY loginid ORDER BY weekSUM DESC"; $result = mysql_query($query); $counter = 1; while ($list = mysql_fetch_array($result)) { $login_id = $list['loginid']; $weeksum = $list['weekSum']; echo <<<_HTML <tr> <td>$counter</td><td>$login_id</td><td>$weeksum</td> </tr> _HTML; $counter++; } echo "</table>"; ?> ][/code] It outputs a table on one of my pages.It works great. My question is: How do I change this code so it will output only certain rows.For example one row in this table looks like: 34|Paul|120 points. When Paul logs in I want to show that his position in the table is 34.How do I change the above code to do just that?
  8. Rookie needs help here.PLEASE read previous posts. Very urgent.
  9. Hi. That is exactly what I needed it.Thank you. I have one more question. Out of this table how do I output a row on another page? For example: 3| Peter|50 (this is one row in the table) How do I output on another page that Peter is in 3. position?Or that Peter has 50 points?Could you help me with the code?
  10. Hello there. I use the following code to output data on one of my webpages: <?php mysql_pconnect("localhost","",""); mysql_select_db(""); $query  = "SELECT loginid,SUM(week1+week2) AS weekSum FROM submit1 GROUP BY loginid ORDER BY weekSUM DESC"; $result = mysql_query($query); while ($list = mysql_fetch_array($result)) { echo "{$list['loginid']}|{$list['weekSum']}<br>"; } ?> It looks something like: John|70 Michael|65 Bill|60 and so on. I would like to align it so that the numbers are in 1 column as well.I know I need padding but I don't know the syntax. Also I want to add a column with order numbers: 1)John|70 2)Michael|65 3)Bill|60.... I am a newbie so PLEASE explain. Thank you in advance.
  11. I am sorry I don't really understand.I am a rookie,remember? How do I output a php counter?I am not familiar with that.Also if you look at one of the previous posts the table is not HTML ,so if you could explain a little bit in details about padding the output for text.
  12. It works great.Thank you. I want to adjust the 'echo' statement so that it will show something like this: 1) John|75 2) Marienne|70 3) Michael|60 and so on. How do I get the order nr 1,2,3 and how do I line up the points 75,70 and 60 to show up in a column nice and neat under one another?
  13. Hi again. I am trying to output the results just like you said. I use the following code: <?php mysql_pconnect("localhost","",""); mysql_select_db(""); $query  = "SELECT loginid,SUM(week1+week2) FROM submit1 GROUP BY loginid ORDER BY 'SUM(week1)+SUM(week2)' DESC"; $result = mysql_query($query); while ($list = mysql_fetch_array($result)) {       echo "{$list['loginid,SUM(week1)+SUM(week2) ']}<br>"; } ?> I am struggling with 2 things. 1)The command DESC isn't working,numbers aren't showing up in descending order. 2)Inside the 'echo' statement something isn't right, I guess it is a syntax error,I want the output to be in a chart ,for example: John|75 Mary|70 Mike|60 and so on. Thank you very much for your help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.