The script made by all!

martian2k4martian2k4 Llama HunterModerator
Ok, This has been done on DevDreams before. But we have new ppl now so lets do it again.

So you can add 3 lines of code onto the script, or edit a previous line and add 1 new line. I will start it off

[PHP]<?php

require("_config.inc.php");

$query = mysql_query("SELECT * FROM `game`");[/PHP]#

CONFIG.INC.PHP CONNECTS TO THE DB k :D
Free MySpace Layouts- Coming soon
Photoshop Tutorials- Coming soon
Premium PHP Scripts- Coming soon

Haha i should really do some work so i can remove all the coming soon's

Comments

  • danielneridanielneri WP V.I.P. VPS - Virtual Prince of the Server
    okay so exactly whats the point of that!?
    ban1.gif
  • PythonPython Forum Leader The Royal RAM
    Yeah I was thinking the same... ??

    The Royal Ram

  • martian2k4martian2k4 Llama Hunter Moderator
    Just the start of a script ...
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • PythonPython Forum Leader The Royal RAM
    Ahh I see so this is supposed to be a thread where we build a script? Correct?

    The Royal Ram

  • CannonBallGuyCannonBallGuy Moderator Shared Hoster
    Yes. A script that everyone adds 3 lines too... ;)

    I have added two lines:

    [php]<?php

    echo "The communal, DevDreams.com script!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");

    ?>[/php]
  • danielneridanielneri WP V.I.P. VPS - Virtual Prince of the Server
    <?php

    echo "The communal, DevDreams.com script!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");

    echo "i have no idea whatelse to write!";

    ?>
    ban1.gif
  • PythonPython Forum Leader The Royal RAM
    [PHP]<?php

    echo "The communal, DevDreams.com script!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");
    while($game = mysql_fetch_array($query))
    {

    }

    echo "i have no idea whatelse to write!";

    ?>[/PHP]

    ^^ I added the mysql_fetch_array loop

    The Royal Ram

  • CannonBallGuyCannonBallGuy Moderator Shared Hoster
    I'm editting my echo line:

    [php]<?php

    echo "<h1>The communal, DevDreams.com script!</h1>\n
    <h2>What it does...</h2>\n
    So far.... Not much!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");
    while($game = mysql_fetch_array($query))
    {

    }

    echo "i have no idea whatelse to write!";

    ?>[/php]


    P.S. Congrats to Python for 4000 posts! :cool:
  • PythonPython Forum Leader The Royal RAM
    <?php

    echo "<h1>The communal, DevDreams.com script!</h1>\n
    <h2>What it does...</h2>\n
    So far.... Not much!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");
    while($game = mysql_fetch_array($query))
    {
    echo $game[gamename]." - ".$game[releasedate]."<br>";
    }

    echo "i have no idea whatelse to write!";

    ?>

    The Royal Ram

  • martian2k4martian2k4 Llama Hunter Moderator
    [php]<?php

    echo "<h1>The communal, DevDreams.com script!</h1>\n
    <h2>What it does...</h2>\n
    So far.... Not much!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");

    $row = mysql_Fetch_array($query);

    if ( mysql_num_rows($row["gamename"]) ) {

    $limit = 10; }

    while($game = mysql_fetch_array($query))
    {

    echo $game[gamename]." - ".$game[releasedate]."<br>";
    }

    echo "i have no idea whatelse to write!";

    ?>[/php]
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • coolhomecoolhome Junior Member Shared Hoster
    Here is what i got to add. I add news ;)
    [php]
    <?php

    echo "<h1>The communal, DevDreams.com script!</h1>\n
    <h2>What it does...</h2>\n
    So far.... Not much!";

    require("_config.inc.php");

    $query = mysql_query("SELECT * FROM `game`");

    $row = mysql_Fetch_array($query);

    if ( mysql_num_rows($row["gamename"]) ) {

    $limit = 10; }

    while($game = mysql_fetch_array($query))
    {

    echo $game[gamename]." - ".$game[releasedate]."<br>";
    }

    echo "i have no idea whatelse to write!";
    // MySql Table
    // news
    // id | title | poster | news
    $news = mysql_query("SELECT * FROM news ORDER BY id DESC");
    while($new1 = mysql_fetch_row($news)) {
    ?>
    <font size=5><?php echo $new1; ?></font> By: <?php echo $new1; ?><br>
    <?php echo new1; ?>
    <hr>
    <br>
    <?php
    }


    ?>
    [/php]
  • coolhomecoolhome Junior Member Shared Hoster
    ok finaly sort of a add on

    [php]
    <?php
    //_config.inc.php//
    mysql_connect('localhost', '***', '***');
    mysql_select_db('***');
    ?>
    [/php]

    [php]
    <?php
    //index.php//
    require("_config.inc.php");
    echo "<h1>The communal, DevDreams.com script!</h1>
    <h2>What it does...</h2>
    So far.... Not much!<br>";

    $game_query = mysql_query("SELECT * FROM games ORDER BY id DESC");
    if(mysql_num_rows($game_query) > 0) {
    while($game = mysql_fetch_row($game_query)) {
    echo "<br>";
    echo $game . " - Released On " . $game . "<br>";
    echo "<a href='" . $game . "'>Click Here To Player</a><hr>";
    }
    } else {
    echo "<br>ERROR: No games inserted!";
    }
    echo "<br>";
    $news_query = mysql_query("SELECT * FROM news ORDER BY id DESC");
    if(mysql_num_rows($news_query) > 0) {
    while($news = mysql_fetch_row($news_query)) {
    echo "<br>";
    echo $news . " By: " . $news . "<br>";
    echo $news . "<hr>";
    }
    } else {
    echo "<br>ERROR: No news inserted!";
    }
    ?>
    [/php]

    See it work at
    http://presto.0web.uni.cc/tester.php

    Also forgot. Mysql crap
    CREATE TABLE `games` (
      `id` int(11) NOT NULL auto_increment,
      `title` text NOT NULL,
      `link` text NOT NULL,
      `released` text NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
    INSERT INTO `games` VALUES (1, 'Homestar Games', 'http://homestarrunner.com/games.html', '10-10-10');
    
    CREATE TABLE `news` (
      `id` int(11) NOT NULL auto_increment,
      `title` text NOT NULL,
      `poster` text NOT NULL,
      `news` text NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
    INSERT INTO `news` VALUES (1, 'Testing', 'Admin', 'This is a test on news ;)');
    
    ;)
Sign In or Register to comment.