SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to fetch all data from database in a column

    PHP Code:
    <html>
    <title>Micro Elite Brigade - Participated Events</title><LINK REL="SHORTCUT ICON" HREF="images/favicon.png"><?php
    require_once('upper.php');
    if(
    $_COOKIE['LoginIdCookie']){
    require_once(
    'database.php');
    require_once(
    'LoginStatement.php');
    $LoginId=$_COOKIE['LoginIdCookie'];
    $query="select * from participation where LoginId='$LoginId'";
    $result=mysqli_query($dbc,$query) or die ('Not Connected');
    //echo "<div class='search_output_data'>
    echo "<table border='0' cellspacing='0' cellpadding='0'>";
    echo 
    "<tr><th align='left' valign='top' width='100' height='20'>Event Title</th>
    <th align='right' valign='top' width='250' height='30'>Date of Participation</th>
    </tr>"
    ;
    while(
    $row=mysqli_fetch_array($result))
    {

    echo 
    "
    <tr><td colspan='4' align='left' valign='top' ><table align='left' border='0' cellspacing='0' cellpadding='0'><tr><td align='left' valign='top'  width='200' height='20'>"
    .$row['Title']."</td> <td width='50'>&nbsp;</td> <td align='left' valign='top' width='130'>".$row['Date']."</td> </tr></table>
    </td></tr>"
    ;
    }
    echo 
    "</table>";}
    else{ echo 
    'Sorry, You must have to login.';}
    require_once(
    'lower.php');

    ?>

    HI friends.....
    I have a table named events in which I have a "Title" column.
    When I print the value of Title column, it not displayed not more than 40 characters....
    Where is the problem ???
    Anyone??????

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Do an echo of $row['Title'] outside of the html table to see if it shows up ok.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Do an echo of $row['Title'] outside of the html table to see if it shows up ok.
    No, it still shows only 40 characters.............

  4. #4
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the datatype of the column?
    Are you specified the length of the column to 40?

    Check for structure of the table and data presented in the table.

  5. #5
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    What is the datatype of the column?
    Are you specified the length of the column to 40?

    Check for structure of the table and data presented in the table.
    Exactly. Use phpMyAdmin (for example) to check the data present in the table.

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Exactly. Use phpMyAdmin (for example) to check the data present in the table.
    I use LongText type and not define its length....
    I already use phpMyadmin and in database no problem with the data, it means there are full data which I inserted but on that page it shows 40 characters only.

  7. #7
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Did you check the html code that is sent to the browser?


Bookmarks

Posting Permissions

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