Jump to content

corrupshun

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Posts posted by corrupshun

  1. "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in B:\wamp\www\sql\select.php on line 17"

     

    this is the starting code I have to making a game sever:

    What does this error mean and what can i do to fix it?

    <?php
    $id = $_GET['gameid'];
    //Username and password to connect
    $con = mysql_connect("localhost","root","");
    
    //check if connection was successful
    if(!$con) {
    echo "Could not connect";
    }
    else {
    echo "Connected to database";
    }
    echo "<br />";
    
    mysql_select_db("Corrupshun", $con);
    $query = mysql_query("SELECT 'Title', 'Path' FROM 'Games' WHERE 'id' = $id");
    $row = mysql_fetch_array($query);
    echo $row['title'];
    echo '<br />'.$row['path'];
    
    
    //while($row = mysql_fetch_array($result)) {
    //echo $row['ID'] . " " . $row['Title'] . " " . $row['Path'];
    //echo "<br />";
    //}
    ?>

    -Thank you very much!

  2. So I've decided to jump into the realm of flash game websites

    Now what I've realized on most sites is one file called something like games.php

    When you click the link to the game you want to play it would be like games.php?gameid=293

    And this would have the same template as all the other games have but loads a different title and flash game.

    I know that the ?gameid=293 is using php GET but how would I implement this? Would it take information from a database? I know I could make a VERY long conditional list but that's obviously the stupid way ;)

    Is this possible without a database?

    If possible please give some code..

    Thanks LOTS!

    -Aus

  3. Don't hate because I didn't use javascript...

    (which would be the solution, but I would like to know how to do this in css)

    CSS:

    body {
    background-color: royalblue;
    font-family: verdana, arial;
    background-image: url(img/bg.gif);
    }
    #page {
    min-width: 800px;
    width: 100%;
    height: auto;
    background-color: blue;
    float: left;
    }
    #preload {
    display: none;
    }
    #banner {
    min-width: 800px;
    width: 100%;
    height: 100px;
    background-color: #491519;
    background-image: url(img/banner.gif);
    background-position: center center;
    background-repeat: no-repeat;
    float: left;
    
    }
    #nav {
    min-width: 800px;
    width: 100%;
    height: 30px;
    background-color: black;
    text-align: center;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
    float: left;
    }
    .button {
    width: 100px;
    height: 30px;
    background-color: #491519;
    color: white;
    float: left;
    border-right: 1px solid white;
    }
    .button:hover {
    background-color: #3d090d;
    }
    #body {
    min-width: 800px;
    width: 100%;
    min-height: 250px;
    height: auto;
    background-color: black;
    float: left;
    }
    .h {
    font-size: 40px;
    color: #0078ff;
    }
    .p {
    text-indent: 20px;
    color: white;
    margin: 10px;
    line-height: 1.3em;
    }
    #images {
    min-width: 800px;
    width: 100%;
    height: 179px;
    background-color: black;
    text-align: center;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
    float: left;
    }
    #images .step1 {
    height: 159px;
    width: 178px;
    margin: 10px 9px 10px 9px;
    background-image: url(img/step1.gif);
    background-color: white;
    float: left;
    }
    #images .step1:hover {
    background-image: url(img/step2.gif);
    }
    
    #images .step2 {
    height: 159px;
    width: 178px;
    margin: 10px 9px 10px 9px;
    background-image: url(img/step3.gif);
    background-color: white;
    float: left;
    }
    #images .step2:hover {
    background-image: url(img/step4.gif);
    }
    #images .step3 {
    height: 159px;
    width: 178px;
    margin: 10px 9px 10px 9px;
    background-image: url(img/step5.gif);
    background-color: white;
    float: left;
    }
    #images .step3:hover {
    background-image: url(img/step6.gif);
    }
    #images .step4 {
    height: 159px;
    width: 178px;
    margin: 10px 9px 10px 9px;
    background-image: url(img/step7.gif);
    background-color: white;
    float: left;
    }
    #images .step4:hover {
    background-image: url(img/step8.gif);
    }
    #copy { 
    min-width: 800px;
    width: 100%;
    height: 25px;
    background-color: black;
    color: white;
    text-align: center;
    float: left;
    }

    HTML:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css.css" rel="stylesheet" type="text/css" />
    <title>Title of Index Page</title>
    </head>
    <body>
    <div id="preload">
    <img src="img/step2.gif" />
    <img src="img/step4.gif" />
    <img src="img/step6.gif" />
    <img src="img/step8.gif" />
    </div>
    <div id="page">
    <div id="banner"></div>
    <div id="nav">
    <div class="button">Home</div>
    <div class="button">Signup</div>
    <div class="button">Proof</div>
    <div class="button">Prizes</div>
    <div class="button">FAQ</div>
    </div>
    <div id="body">
    <div class="h">Header</div>
    <div class="p">
    This is the general place I type however I feel.
    </div>
    </div>
    <div id="images">
    <div class="step4"></div>
    <div class="step3"></div>
    <div class="step2"></div>
    <div class="step1"></div>
    </div><!--images-->
    <div id="copy">
    © 2009
    </div>
    </div>
    </body>
    </html>

    If you make the page you will see that step1 2 and 3 are floated to the left.. I can't seem to center them.. How can I while still keeping them floated? (if they're not floated it don't work)

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