Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. how can i get it to echo 5 images and then a br

     

    i was trying this code:

     

    <?php
    for ($i=0; $i<1; $i++) 
    {
    if ($i < 1) 
    {
    $query = mysql_query("SELECT * FROM `image_gallery` ORDER BY id DESC");
    while ($row = mysql_fetch_array($query)) 
    {
    $i++;
    echo "<img src='$row[image_url]' height='100' width='100'>"; 
    }
    }else{
    echo "<br />";
    }
    ?>
    

     

    it didnt seem to work.. anyone got any ideas?

  2. its not really a webhost... there are places where you can put your server, where i live in holland there is a phone companie called KPN that runs your server for a charge of 30 euro a month with an internt speed of 30mbps

  3. sometimes i wonder what the big advantage is of haveing your own server at home. i peronally think its better to buy a server and then find an internet provider that also provides services of running it, usually this saves alot of money on electricity bills and you get a far faster connection, whilst still being able to run whatever you want on it

  4. ill put it in php tags... the mysql isnt my porblem... im not sure what loop i should be using and how i should be using it

     

    echo "<form METHOD=get><input type=hidden name=view value=Message><table width=70% border=0 cellspacing=1 cellpadding=0>
    <tr><td background=images/forum_board.jpg height=25 width=0></td><td background=images/forum_board.jpg height=25 width=33%><b><center>Subject</center></b></td><td background=images/forum_board.jpg height=25 width=33%><b><center>From</center></b></td><td background=images/forum_board.jpg height=25 width=33%><b><center>Date</center></td></tr>";
    $slimit = $action*15;
    $llimit = ($action+1)*15;
    $pms = mysql_query("SELECT * FROM pm WHERE pm_to='$get_user[id]' ORDER BY id DESC LIMIT $slimit, $llimit");
    while ($message = mysql_fetch_array($pms)) {
    $from = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='$message[pm_from]'"));
    echo "<tr><td bgcolor=#111111 height=25 width=0><input type=radio name=action value=$message[id] /></td><td bgcolor=#111111 width=33%>- <a href='?page=MessageCenter&view=ViewMessage&action=$message[id]' title='$message[text]'>$message[subject]</a></td><td width=33% bgcolor=#111111><a href=?page=Profile&view=$from[id]> $from[username]</a> [$from[id]]</td><td bgcolor=#111111 width=33%> $message[date]</td></tr>";}
    echo "</table><table width=70%><tr><td><div align=left><img src=images/arrows_up.png> <input type=submit name=page value=Delete class=form size=5> <input type=submit name=page value=Reply class=form size=5></td></tr></table></form>";
    
    //the code i need help with
    $pmrows = mysql_num_rows(mysql_query("SELECT * FROM pm WHERE pm_to='$get_user[id]'"));
    while($pmrows>$llimit){
    $i++;
    $p=$l-1;
    echo "<a href=?page=MessageCenter&action=$p>$i</a>"; }

     

    you may notice the reason it looks messy is beacuase its just a big echo...

  5. hi, i dont know much about using loops.. i know a little about while loops so i tried using one for trying to display how many pages of message you have in your inbox.. (this froze my computer)

     

    heres some of my code

    echo "<form METHOD=get><input type=hidden name=view value=Message><table width=70% border=0 cellspacing=1 cellpadding=0>
    <tr><td background=images/forum_board.jpg height=25 width=0></td><td background=images/forum_board.jpg height=25 width=33%><b><center>Subject</center></b></td><td background=images/forum_board.jpg height=25 width=33%><b><center>From</center></b></td><td background=images/forum_board.jpg height=25 width=33%><b><center>Date</center></td></tr>";
    $slimit = $action*15;
    $llimit = ($action+1)*15;
    $pms = mysql_query("SELECT * FROM pm WHERE pm_to='$get_user[id]' ORDER BY id DESC LIMIT $slimit, $llimit");
    while ($message = mysql_fetch_array($pms)) {
    $from = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='$message[pm_from]'"));
    echo "<tr><td bgcolor=#111111 height=25 width=0><input type=radio name=action value=$message[id] /></td><td bgcolor=#111111 width=33%>- <a href='?page=MessageCenter&view=ViewMessage&action=$message[id]' title='$message[text]'>$message[subject]</a></td><td width=33% bgcolor=#111111><a href=?page=Profile&view=$from[id]> $from[username]</a> [$from[id]]</td><td bgcolor=#111111 width=33%> $message[date]</td></tr>";}
    echo "</table><table width=70%><tr><td><div align=left><img src=images/arrows_up.png> <input type=submit name=page value=Delete class=form size=5> <input type=submit name=page value=Reply class=form size=5></td></tr></table></form>";
    
    //the code i need help with
    $pmrows = mysql_num_rows(mysql_query("SELECT * FROM pm WHERE pm_to='$get_user[id]'"));
    while($pmrows>$llimit){
    $i++;
    $p=$l-1;
    echo "<a href=?page=MessageCenter&action=$p>$i</a>"; }
    


  6. i was thinking of using a while loop to select the stuff from the database..

    then every loop contains $i++;

     

    but then i was stuk with where to put my if statement..

     

    maybe if i tried

     

    $page = $_GET


    ;

    $pms = mysql_query("SELECT * FROM pm WHERE id='$pm_id' ORDER BY id DESC");

    while ($message = mysql_fetch_array($pms) && $i<$page*15) {

    $i++;

    }

     

    but again im stuck...

  7. $sql = "insert into message set

      mess='$message',

    poster='$poster',

      date=CURDATE()";

     

    does this work??

     

    try this, your probobally not seeing an error because your @ infront of the mysql_query

    $sql = "INSERT INTO clan_apps (`mess`, `poster`, `date`)VALUES('$message','$poster', 'CURDATE()')";

×
×
  • 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.