Results 1 to 3 of 3

Thread: How do i display data from mysql database?

  1. #1
    Join Date
    Jan 2008
    Kuala Lumpur
    Rep Power

    How do i display data from mysql database?

    I have this simple program that require me to display data from database. It works previously on my other program. I dont know what went wrong for this one. Here i put :

    include 'connection.php';
    $id = $_GET['id'];
    $select_id = "SELECT * from meeting WHERE id_meet='$id'";

    $result = mysql_query($select_id) or die (mysql_error());
    $row = mysql_fetch_array($result);

    $meet_name = stripslashes ($row["name"]);
    $meet_designation = stripslashes ($row["designation"]);
    $meet_id_no = stripslashes ($row["id_no"]);
    $meet_subject = stripslashes ($row["subject"]);

    <TR><TD width=166 height="25"><DIV align=left><FONT face="Tahoma" color="#000000" size="2"> Name: </FONT></DIV></TD><TD width="355" height="25"><DIV align=left><FONT face="Tahoma" color="#000000" size="2"><?php echo "$meet_name"; ?></FONT></DIV></TD></TR>

    and so on for the designation,id_no and subject.
    Please help me on this!!
    Thank you

  2. #2
    Join Date
    Apr 2004
    Rep Power
    Everything seems to be okay to me. What was / were the error(s) being thrown?
    ""If you must break the law, do it to seize power: in all other cases observe it." - Julius Caesar

  3. #3
    Join Date
    Oct 2005
    Rep Power
    yeah man. its like you go to see a doctor and say you're sick, but the doctor cant touch or ask you anything. unless the doctor is psychic, how you expect you the doctor to help you?

    when you displayed the page, did you see any error messages or its just a blank page?

    btw, i see here 2 fields from the table, 'id_meet' and 'id_no'. does the table really have 2 'id' fields?

    if it does, the 'id_meet' seemed to be quoted in the query. whats the field type? if its a varchar, char, text, etc., then it cant be the primary key or unique. in this case, the result could return more than 1 row. therefore you might be getting the wrong result since there are no loops to display them, if there are more than 1.

    also, there are no 'table' tags. some browsers might not display the table and its contents.
    Last edited by afroman; 14-01-2008 at 10:20 AM. Reason: add more
    klaatu barada nikto

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Database change with MySQL
    By heboo in forum Webmaster Tools
    Replies: 1
    Last Post: 14-09-2009, 09:47 PM
  2. help tak boleh display
    By beih107 in forum Website Programming
    Replies: 2
    Last Post: 18-05-2007, 10:08 AM
  3. Big Dump Mysql database
    By ftpserver in forum Website Programming
    Replies: 4
    Last Post: 29-04-2007, 06:21 PM
  4. display database mysql
    By sangasura in forum Website Programming
    Replies: 2
    Last Post: 19-09-2005, 03:45 PM
  5. display data,camne???
    By adib in forum Website Programming
    Replies: 14
    Last Post: 21-08-2004, 10:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37