Jump to content

npsari

Members
  • Posts

    393
  • Joined

  • Last visited

Posts posted by npsari

  1. Hi there

     

    In my website, users are allowed to upload 1 image

    but some people upload huge images, which slows down everything

     

    Is there anyway that when someone uploads an image, the image is shrinked automatically and converted to gif or something

     

    I think in Myspace for example, when i upload a huge image, something happens to it, and becomes smaller, with a bad resolution

     

    does anyone know how can i do this in my site

    Is there a way to convert hige images upon upload

     

    Thanks

  2. Hi there

    I have a table called name

    In which, i have a row called names

     

    i use this little code to show the last 3 names

     

    $con=mysql_connect("$Connect", "$Name", "$Pass"); 
    mysql_select_db("$Database", $con); 
    
    $q = "SELECT * FROM name LIMIT 3;";
    $res = @mysql_query($q);
    while($r = @mysql_fetch_array($res)){	
    print"<FONT style=\"font-size:11px\" color=\"#000000\" face=\"Arial\">$r[name]</FONT><br>";
    }

     

    but i dont want all names to be black color

    I want the first name black (000000)

    the second red (ff0000)

    the third blue (0000FF)

     

    How can i write the above code plz

  3. I have this little php code

    in which, i join two tables

     

    $qX = "SELECT c.category_name, c.category_id, c.category_info, t.topic_category_id
    FROM category c
    LEFT JOIN topic t
    ON t.topic_category_id = c.category_id
    ORDER BY c.category_id ASC";

     

    I want to add this bit

     

    COUNT(t.topic_category_id) as CNT

     

    Where do i put it in the above code

     

    Wherever i add it, the query does not work completely

     

    i tried for example

     

    $qX = "SELECT c.category_name, c.category_id, c.category_info, t.topic_category_id
    COUNT(t.topic_category_id) as CNT
    FROM category c
    LEFT JOIN topic t
    ON t.topic_category_id = c.category_id
    ORDER BY c.category_id ASC";

     

    It doesnt work

  4. hello there

     

    in my phpbb forums, i am using this code to display the image of the person who posted a topic (I am joining 2 tables)

     

    SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, u.user_avatar
    FROM phpbb_topics t
    LEFT JOIN phpbb_users u
    ON u.user_id = t.topic_poster
    ORDER BY t.topic_last_post_id DESC LIMIT 10

     

    So now, the above code gets the image of the user where user_id = topic_poster

     

    but i also want to show the image of the person who replied too

     

    if the person who last replied is stored as letest_reply_poster in a table called replies

     

    how can i write the above code please

     

     

  5. I added the GROUP BY, it worked and thinsga re not repeated, but now, the topics are not ordered by the latest reply (r.reply_date, r.reply_time)

     

    $q = "SELECT DISTINCT t.topic_id, t.topic_name, t.topic_category_id, t.topic_date, t.topic_time, u.Image1, m.category_name, u.ID, r.reply_date, r.reply_time

    FROM topic t

    LEFT JOIN profile u

    ON u.ID = t.topic_who

    LEFT JOIN category m

    ON t.topic_category_id = m.category_id

    LEFT JOIN reply r

    ON t.topic_id = r.reply_topic_id

    GROUP BY t.topic_id

    ORDER BY r.reply_date DESC, r.reply_time DESC LIMIT 9;";

     

    Any other hint plz

  6. Hi  :)

     

    q = "SELECT DISTINCT t.topic_id, t.topic_name, t.topic_category_id, t.topic_date, t.topic_time, u.Image1, m.category_name, u.ID, r.reply_date, r.reply_time
    FROM topic t
    LEFT JOIN profile u
    ON u.ID = t.topic_who
    LEFT JOIN category m
    ON t.topic_category_id = m.category_id 
    LEFT JOIN reply r
    ON t.topic_id = r.reply_topic_id
    ORDER BY t.topic_date DESC, t.topic_time DESC LIMIT 9;";

     

    The above code does not display distinct topic_id

    it gets repeated many times

    Can you tell me how to fix it please

  7. Hi

     

    I have this Javascript

     

    Everytime i click on a color box, this color code is typed in a tex field called C1

     

     
    
    <form name="Code" method="POST" action="/code/scroll.php" enctype="text/plain" id="">
    
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function showColor(val) {
    document.Code.C1.value = val;
    }
    //  End -->
    </script>
    
    
    <map name="colmap">
    <area shape="rect" coords="1,1,7,10" href="javascript:showColor('#00FF00')">
    <area shape="rect" coords="9,1,15,10" href="javascript:showColor('#00FF33')">
    <area shape="rect" coords="17,1,23,10" href="javascript:showColor('#00FF66')">
    <area shape="rect" coords="25,1,31,10" href="javascript:showColor('#00FF99')">
    <area shape="rect" coords="33,1,39,10" href="javascript:showColor('#00FFCC')">
    <area shape="rect" coords="41,1,47,10" href="javascript:showColor('#00FFFF')">
    <area shape="rect" coords="49,1,55,10" href="javascript:showColor('#33FF00')">
    <area shape="rect" coords="57,1,63,10" href="javascript:showColor('#33FF33')">
    <area shape="rect" coords="65,1,71,10" href="javascript:showColor('#33FF66')">
    <area shape="rect" coords="73,1,79,10" href="javascript:showColor('#33FF99')">
    <area shape="rect" coords="81,1,87,10" href="javascript:showColor('#33FFCC')">
    <area shape="rect" coords="89,1,95,10" href="javascript:showColor('#33FFFF')">
    </map>
    
    <a><img usemap="#colmap" src="http://www.example.com/code/colortable.gif" border=0 width=289 height=67></a>
    
    
    <input type=text name=C1 size=7>
    
    
    </form>

     

     

     

    I want to do a little change to the code, so that, everytime i click on a color, the background of a Table changes

     

    Here is my table

     

    <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="background-color:#8B8B00" id="Table1">
    <tr>
    <td align="left" valign="top" width="128" height="150">
    Hello There
    </td>
    </tr>
    </table>

    Do you think you can do this for me

     

    How can the table backround change when a color box is clicked

     

    I have the table html ready above, i just need the Javascript which will change it

     

    If it is easy, please show me the javascript part

  8. Hi there,

     

    I have a community website

     

    At the moment, the way of seeing a user's profile is ...

     

    http://www.example.com/users.php?user=7

     

    But now, I want users to have a real link

     

    http://www.example.com/sara

     

     

    Like Myspace does, which allows you to choose an URL

     

    How does a website do that, do i create folders for users in my public folder directory

    is that how it is done?

     

    What if there is thousands of users... Will i end up having thousands of folders in my public directory

     

    So, Myspace has billions of folders then

     

    Can you tell me how this is done

  9. ohh i see

     

    hmm, no reason i guess

    but i am just worried

     

    cus iam sure you know how hard it is to change the id to ID

     

    all my site is set up to ID now

     

    And i was thinking, what if... capital letters where disabled for mySQL tables  :)

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