Jump to content

csabi_fl

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by csabi_fl

  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.
  14. I want my members to be able to click on a link that takes them to this summary table so they can check their standings.A link between my webpage and mysql table is what I am looking for.Does that make sense?
  15. It works great,thank you. One more thing.How do I link this summary table from my webpage?
  16. I am not sure I understand.How can I do that on the fly and how do I make that summary table?I am very new to this so please explain. Thank you again.
  17. Hi guys. I need some help with my table.It looks something like this: loginid|week1|total: John|5|0 John|7|0 John|3|0 Now in the 'total' column (where all the 0's are)I want to have the sum of 'week1'(5+7+3).I think I need the UPDATE command but I don't know how to phrase it. Something like: UPDATE * SET total=???? WHERE loginid='John'. Is that possible to have the total in only 1 row not in all 3 of them? Thank you in advance.
  18. It makes a lot of sense.I think it's an excellent idea.The only thing that I am not familiar with is the INSERT IGNORE command.I tried to look it up in the Mysql documentation but there isn't much there.Could you tell me how to use it in my case?
  19. I'm afraid I don't understand.I am not a pro,could you be a little more specific,PLEASE.
  20. Hi. I am building a website and I am stuck . I have a form on one of my pages that has 5 fields(M,Tu,W,Th and F).Each field contains a question .Members have to answer each question in any particular order and one at a time.When they for instance answer question M and click on submit the answer goes into a table in my database.I use Mysql.Now the table has 6 columns :loginid,M,Tu,W,Th and F. What I need is a code that inserts the data into the table one at a time and I want to have only one row,something like this: loginid/answer to M/answer to Tu/answer to W/answer to Th/answer to F, so everything is nice and neat. And one more thing,I want to prevent them from sending in an answer to the same question twice. Please help me out , I have been trying for about a month now with no success. Thank you very much in advance for your time.
×
×
  • 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.