Jump to content

Mossman

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Posts posted by Mossman

  1. Something like this for the style sheet:

     

    
    #leftcolumn {
    width:20%;
    }
    
    #textbox{
    word-wrap: break-word;
    overflow: hidden;
    height: auto;
    border: #0099CC solid 1px;
    background-color: #FFFFFF;
    }
    
    #header {
    background-color:#009900;
    border: #0099CC solid 1px;
    }
    
    #footer {
    background-color:#009900;
    border: #0099CC solid 1px;
    }
    
    

     

    And the html like this:

     

    
    <body>
    <div id='leftcolumn'>
    
    <div id='header'>
    Header.
    </div>
    
    <div id='textbox'>
    This is a load of text.
    </p>
    Blah blah blah
    </div>
    
    <div id='footer'>
    Footer.
    </div>
    </div>	
    
    </body>
    

     

    ...ought to solve it.  The text box will change size automatically depending on how much you put in it as long as you don't specify a size eg height: 50px;

  2. Hi,

     

    I need to produce a news feed on a website.  I am going to create a table to store the individual news articles but I only want to show, say; the three most recent articles on the home page.  Does anyone have any recommendations on how to go about it?

     

    I know it's probably quite a simple query for you guys but I'm a bit of a newb  :D

  3. Hey im trying to convert my old html methods to the new CSS

     

     

    But am having difficulty as my images are "on top" of the text so you can see the image but the text cannot be seen.... how do i correct this.. this is what i got:

     

     

    I usually stick my images into div's on my CSS page.  It means your html will be much neater too.  I didn't understand if you were having problems with the image literally covering the text or just appearing below it on the page or something?  I would insert my image like this:

     

    #banner {
    background-image:url(file:///C|/Documents and Settings/etc.jpg);
    width: 800px;
    height: 200px;
    margin-left: 5px;
    margin-top: 20px;
    border: 1px #000 solid;
    }
    

     

    Then you could just call the image with <div id='banner'> and move it's position with different margins.  You can then write over it with your text as well by putting it inside the image div

     

     

     

     

  4. Hi,

     

    I have been reading previous threads on dynamic lists.  I just want to populate a list with a field from a table.

     

    The code I am using is:

     

    echo "<select name='selectcompany'>";
    echo "<option value=$row[ar_name]>$row[ar_name]</a></option>";
    echo "</select>";
    

     

    It is taking each record and putting the results in their own seperate lists rather than all in the same drop down list.  I know it's probably something simple I'm not doing but I've tried other peoples solutions and it's not working for me.

     

    I'd appreciate any suggestions!

  5. I am fairly new to php so I'm aware that I'm probably doing this in the most illogical way possible so I'd appreciate some alternative suggestions.  I basically have two tables 'users' and 'celebrities', the user table contains a dream team of celebrities which the idea is they get points for based on their weekly exploits.  I want to compare a users choices with the celebrity table to get the weekly points for that celebrity and store it in a variable which will then all be added together at the end to get a weekly total of points.

     

    I use this code and repeat it 11 times to get the points for each celebrity in the team:

     

    $query1 = sprintf("SELECT weekpoints FROM celebrities WHERE name = '" . $choice1 ."'");

    $result1 = mysql_query($query1);

    if (!$result1) {

        $message  = 'Invalid query: ' . mysql_error() . "\n";

        $message .= 'Whole query: ' . $query1;

        die($message);

    }

    while ($row = mysql_fetch_assoc($result1)) {

     

    $value1 = $row ['weekpoints'];

     

    At the end I then update the relevant user record with this code: -

     

    $query12 = sprintf("SELECT * FROM users WHERE username='$username'",

    "UPDATE users SET weekpoints = '$update', totalpoints = '$newpoints' WHERE username = '" . $username ."' ");

    $result12 = mysql_query($query12);

    if (!$result12) {

        $message  = 'Invalid query: ' . mysql_error() . "\n";

        $message .= 'Whole query: ' . $query12;

        die($message);

    }

    while ($row = mysql_fetch_assoc($result12)) {

     

    echo $newpoints;

    echo "<br>";

    echo $totalpoints;

     

    }

     

    As it stands i'm getting the wrong result at the end so something is going wrong, and the whole page is about 250 odd lines of code!  I'm sure there is probably a better way about it!  I'd appreciate any suggestions!  (And please don't laugh  ;D)

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