php help plzz

sudu hawa

Well-known member
  • Dec 1, 2011
    1,626
    100
    63
    යාලුවනේ මට දැන ගන්න ඔනේ php result එකක් පහල තියෙන කොඩ් එක අනුව පහලට තමයි result එක එන්නේ මට ඔනේ right සයිඩ් එකට view කර ගන්න කවුරැ හරි පොඩ්ඩක් කියලා දෙන්න... :oo::oo: ලොකු පිනක් ...............:yes::yes:

    <?php
    $username = "user";
    $password = "147147";
    $hostname = "localhost";
    $con=mysql_connect($hostname,$username,$password) ;
    mysql_set_charset('utf8',$con);
    $select = mysql_select_db("information", $con);
    $result = mysql_query("select id,Poster FROM test");
    while ($row = mysql_fetch_array($result)) {

    ?>

    <?php echo $row['poster'];?>
     

    ilanganthilaka

    Well-known member
  • Jun 4, 2008
    12,435
    1,004
    113
    ithin ban oya code eken kohomada pahala print wenne. oken L to R thama print wenne. data base eke image eke file name and path eka poster field eke store katagana img tag eka dala print karanna eka lesi. data base eke image kelinma sore karanna epa. path eka witharak store karanna
     

    Ayeshlive

    Well-known member
  • Jul 1, 2011
    10,570
    943
    113
    *̶͑̾̾​̅ͫ͏̙̤g͛͆̾ͫ̑͆&
    Machan MVC pattern eka follow karanna. oya karana widihata complex site ekak karanna amarui. HTML and PHP ekata dammama patta amarui complex layout ekak hadanna.

    PHP:
    <?php
    $username = "user";
    $password = "147147";
    $hostname = "localhost";
    $con=mysql_connect($hostname,$username,$password) ;
    mysql_set_charset('utf8',$con);
    $select = mysql_select_db("information", $con);
    $result = mysql_query("select id,Poster FROM test");
    while ($row = mysql_fetch_array($result)) {
      ?>
      <div class="post-item grid-aligned">
       <div class="poster">
      <?php echo $row['poster'];?>
      </div>
      </div>

    CSS:
    Code:
    .grid-aligned {
      float: left;
      width: XXXXpx;
      height: YYYYpx;
      position: relative;
    }
    .post-item {
      border: 1px solid #eee;
      border-radius: 10px;
    }

    Meka karanna one me wage display eka DIV tags walin wrap karala eeta passe e div tags walata CSS apply karana eka machan.
     

    Dragonborn

    Member
    Apr 22, 2013
    135
    19
    0
    Code:
    <?php
    $username = "user";
    $password = "147147";
    $hostname = "localhost";
    $con=mysql_connect($hostname,$username,$password) ;
    mysql_set_charset('utf8',$con);
    $select = mysql_select_db("information", $con);
    $result = mysql_query("select id,Poster FROM test");
    echo "<table border='0'><tr>";
    $count=0;
    while ($row = mysql_fetch_array($result)) {
    echo "<td>";
    echo "<img>".$row['poster']."</img>";
    echo "</td>";
    $count++;
    if($count > 5)
    {
    $count=0;
    echo "</tr>";
    echo "<tr>";
    }
    }
    ?>


    මේක try කරලා බලන්න. එක row එකක images 5 ක් එන්න මේක හදලා තියෙන්නේ/ Test කරේ නම් නෑ. ^_^
     
    Last edited:

    sudu hawa

    Well-known member
  • Dec 1, 2011
    1,626
    100
    63
    Code:
    <?php
    $username = "user";
    $password = "147147";
    $hostname = "localhost";
    $con=mysql_connect($hostname,$username,$password) ;
    mysql_set_charset('utf8',$con);
    $select = mysql_select_db("information", $con);
    $result = mysql_query("select id,Poster FROM test");
    echo "<table border='0'><tr>";
    $count=0;
    while ($row = mysql_fetch_array($result)) {
    echo "<td>";
    echo "<img>".$row['poster']."</img>";
    echo "</td>";
    $count++;
    if($count > 5)
    {
    $count=0;
    echo "</tr>";
    echo "<tr>";
    }
    }
    ?>
    මේක try කරලා බලන්න. එක row එකක images 5 ක් එන්න මේක හදලා තියෙන්නේ/ Test කරේ නම් නෑ. ^_^
    wada nathoooo
     

    Xxo0oxX

    Member
    Oct 2, 2012
    1,585
    114
    0
    man dan na ube code eka wadada kiyala man check kale na eth ubata pahalata hari echo wenawa kiwa nisai meka damme


    <?php
    $username = "user";
    $password = "147147";
    $hostname = "localhost";
    $con=mysql_connect($hostname,$username,$password) ;
    mysql_set_charset('utf8',$con);
    $select = mysql_select_db("information", $con);
    $result = mysql_query("select id,Poster FROM test");
    while ($row = mysql_fetch_array($result)) {

    ?>
    <div class="what_ever">
    Me hariyata ube Right Div eke set eka danna Site eke balanna ube right panal eke name eka mokakda kiyala
    uba div da use karanne?:rolleyes:


    <?php echo $row['poster'];
    }
    ?>
    </div>