Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    Oct 2006
    Posts
    263
    Tokens
    0

    Default

    Sorry, didnt see your post.
    Last edited by James.Easy; 04-11-2006 at 12:30 PM.
    VB Programmer looking for work

  2. #12
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    Code:
    CREATE TABLE search(
    id INT NOT NULL AUTO_INCREMENT,
    PRIMARY KEY(id),
    name VARCHAR(30) NOT NULL,
    url VARCHAR(30) NOT NULL,
    about TEXT NOT NULL)';
    is the rite code. i hope.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  3. #13
    Join Date
    Oct 2006
    Posts
    263
    Tokens
    0

    Default

    Error

    There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

    ERROR: Unclosed quote @ 143
    STR: '
    SQL: CREATE TABLE search(
    id INT NOT NULL AUTO_INCREMENT,
    PRIMARY KEY(id),
    name VARCHAR(30) NOT NULL,
    url VARCHAR(30) NOT NULL,
    about TEXT NOT NULL)'


    SQL query:

    CREATE TABLE search( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30) NOT NULL, url VARCHAR(30) NOT NULL, about TEXT NOT NULL)'

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 6
    VB Programmer looking for work

  4. #14
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    :s mysql aint my thing.
    http://www.colin-roberts.net/search.gz
    theres a blank mysql database with tables installed.
    Last edited by Colin-Roberts; 04-11-2006 at 01:01 PM.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  5. #15
    Join Date
    Oct 2006
    Posts
    263
    Tokens
    0

    Default

    It sttill doesnt work, ggrr.I really need this.I'm rubbish with mySQL as well.
    VB Programmer looking for work

  6. #16
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    the mysql has to be fine now did you edit your mysql details into the files

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  7. #17
    Join Date
    Oct 2006
    Posts
    263
    Tokens
    0

    Default

    I fixed it, made my own querie.

    CREATE TABLE `search` (
    `id` int(11) NOT NULL auto_increment,
    `url` varchar(30) NOT NULL default '',
    `name` varchar(255) NOT NULL default '',
    `about` varchar(40) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM;

    Search.PHP has a error.
    Last edited by James.Easy; 04-11-2006 at 01:20 PM.
    VB Programmer looking for work

  8. #18
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    theres search.php code took from my working one..
    make sure to add mysql details.
    PHP Code:
    <?php
    $dbhost
    ='localhost';
    $dbusername='';
    $dbuserpass='';
    $dbname '';

    mysql_connect ($dbhost$dbusername$dbuserpass);
    mysql_select_db($dbname) or die('Cannot select database');

    $rowsPerPage 5;
    $pageNum 1;

    if(isset(
    $_GET['page']))
    {
    $pageNum $_GET['page'];
    }
    if(isset(
    $_GET['search']))
    {
    $search $_GET['search'];
    }

    // counting the offset
    $offset = ($pageNum 1) * $rowsPerPage;

    $keywords explode(" "$search);

    $query "SELECT id,name,about,url FROM search " .
    "WHERE about LIKE '%".$keywords['0']."%'";

    for (
    $i=1$i<count($keywords); $i++) {
    $query $query." AND about LIKE '%".$keywords[$i]."%'";
    }
    $query $query." ORDER BY id LIMIT $offset$rowsPerPage";

    $result2 mysql_query($query) or die(mysql_error());
    ?>
    <html>
    <head>
    <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
    <title>Cj Search - Results</title> 
    <link type="text/css" rel="stylesheet" href=/v4/search/css.css">
    </head>
    <body>
    <center>
    <img style="margin: 0px;" width="690" height="150" title="" alt="" src="http://www.colin.connect-hosting.com/v4/colinrobertsyf1.PNG">
    </br>
    <form method="GET" action="search.php">
    <b>Search:</b> <input type="text" name="search" size="20" />
    <input type="submit" value="Search!" />
    </form>
    <table width="50%" style="border:1px solid #000000;">
    </body>
    </html>
    <?php
    $keywords 
    explode(" "$search);

    $query "SELECT COUNT(id) AS numrows FROM search " .
    "WHERE about LIKE '%".$keywords['0']."%'";

    for (
    $i=1$i<count($keywords); $i++) {
    $query $query." AND about LIKE '%".$keywords[$i]."%'";
    }

    $result mysql_query($query) or die('Error, query failed');
    $row mysql_fetch_array($resultMYSQL_ASSOC);
    $numrows $row['numrows'];

    $maxPage ceil($numrows/$rowsPerPage);

    $self $_SERVER['PHP_SELF'];
    $nav '';

    for(
    $page 1$page <= $maxPage$page++)
    {
    if (
    $page == $pageNum)
    {
    $nav .= $page ";
    }
    else
    {
    $nav .= " <a href=\"$self?page=$page&search=$search\">$page</a> ";
    }
    }

    if (
    $pageNum 1)
    {
    $page $pageNum 1;
    $prev " <a href=\"$self?page=$page&search=$search\">[Prev]</a> ";

    $first " <a href=\"$self?page=1&search=$search\">[First Page]</a> ";
    }
    else
    {
    $prev ' ';
    $first ' ';
    }

    if (
    $pageNum $maxPage)
    {
    $page $pageNum 1;
    $next " <a href=\"$self?page=$page&search=$search\">[Next]</a> ";

    $last " <a href=\"$self?page=$maxPage&search=$search\">[Last Page]</a> ";
    }
    else
    {
    $next ' ';
    $last ' ';
    }

    while(
    $row mysql_fetch_array($result2))
    {
    echo 
    "<tr>";
    echo 
    "<td style='border-bottom: 1px solid #000000;'>";
    echo 
    "<b><a href=\"".$row['url']."\">".$row['name']."</a></b>";
    echo 
    "<p>".$row['about']."</p>";
    echo 
    "<p><a href=\"".$row['url']."\">".$row['url']."</a></p>";
    echo 
    "</td>";
    echo 
    "</tr>";
    }

    echo 
    "<tr>";
    echo 
    "<td>";
    echo 
    "<center>".$first $prev $nav $next $last."</center>";
    echo 
    "</td>";
    echo 
    "</tr>";
    ?>
    </td>
    </tr>
    </table>
    </br>
    <span class="nav"><font size="1" face="Verdana"><span class="nav">| <a href="/v4/search/add.php" title="">Add Your Site</a> | <a href="/terms.htm">Terms</a> | <a href="/credits.htm">Credits</a> |</span></font>
    </center>

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  9. #19
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    search.php has error and we need a crawling spider to add sites

    Edit: search works now we need a spider to add to it
    Last edited by -::Mr.Dave::-; 04-11-2006 at 01:34 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •