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 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default Silly msql error.

    Hey guys, just got onto coding something and I get this silly mysql error which I've never even heard of.

    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/blah/public_html/thing/testing.php on line 4

    This is my code.
    PHP Code:
    <?php
    session_start
    ();
    $conn mysql_connect("localhost""user""password");
    mysql_select_db("db""$connect") or die(mysql_error());
    ?>
    Now as you can see line 4 is just selecting my database, any clues? +REP.

    Also I've checked my tables to make sure nothing numerical is there, all fine.

    Moved by Invent (Forum Moderator) from Design & Development: Please post in the correct forum next time, thanks .
    Last edited by Invent; 12-07-2008 at 12:10 PM.

  2. #2
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent View Post
    Hey guys, just got onto coding something and I get this silly mysql error which I've never even heard of.

    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/blah/public_html/thing/testing.php on line 4

    This is my code.
    PHP Code:
    <?php
    session_start
    ();
    $conn mysql_connect("localhost""user""password");
    mysql_select_db("db""$connect") or die(mysql_error());
    ?>
    Now as you can see line 4 is just selecting my database, any clues? +REP.

    Also I've checked my tables to make sure nothing numerical is there, all fine.
    Are you seriously stupid?

    $conn = mysql_connect("localhost", "user", "password");
    mysql_select_db("db", "$connect") or die(mysql_error());

    There's a clue.

  3. #3
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Independent View Post
    Are you seriously stupid?

    $conn = mysql_connect("localhost", "user", "password");
    mysql_select_db("db", "$connect") or die(mysql_error());

    There's a clue.
    Are you seriously stupid? This doesn't even matter.

  4. #4
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Excellent View Post
    Are you seriously stupid? This doesn't even matter.
    $conn is being called for no reason, and $connect doesn't exist.

    :eusa_clap

    Own up to your mistake.. I am right, you are wrong.

    So by the looks of it, I am better at php than you if you couldn't realize that.
    Last edited by Independent; 12-07-2008 at 12:20 AM.

  5. #5
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    PHP Code:
    //Connect to the mysql database
    $conn mysql_connect("localhost""user""password");

    //Select DB using the correct connection variable.
    mysql_select_db("db"$conn) or die(mysql_error()); 
    I'm not sure on need the " around $conn... you don't even really need to define which connection to select the database if you only have that 1.
    Last edited by Source; 12-07-2008 at 12:29 AM.


    www.fragme.co = a project.

  6. #6
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by GasFMatt View Post
    PHP Code:
    //Connect to the mysql database
    $conn mysql_connect("localhost""user""password");

    //Select DB using the correct connection variable.
    mysql_select_db("db"$conn) or die(mysql_error()); 
    There you go "Lucas" you needed a guide to connect to a database, flipping hell.. YOUR PROJECT IS GOING TO BE MASSIVE, MORE MASSIVE THAN MYSPACE OR BEBO OR ANY OTHER POPULAR WEBSITE! WOAH, LOVE IT MAN.

  7. #7
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Independant. Leave off, everyone makes silly mistakes every now and then - because they think the problem is deeper than it actually lyes.

    So leave it, and grow up a little bit.


    www.fragme.co = a project.

  8. #8
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by GasFMatt View Post
    Independant. Leave off, everyone makes silly mistakes every now and then - because they think the problem is deeper than it actually lyes.

    So leave it, and grow up a little bit.
    Lol, "Lucas" seems to notice my mistakes and do the exact same.

  9. #9
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Independent View Post
    $conn is being called for no reason, and $connect doesn't exist.

    :eusa_clap

    Own up to your mistake.. I am right, you are wrong.

    So by the looks of it, I am better at php than you if you couldn't realize that.
    Okay listen now, $conn is my function name. $connect is being used to connect to the database. Since when do $conn and $connect even come to comprehend the same word? Also why do you keep calling me "lucas" congratulations kiddy, you know my name? Oh btw stop thinking you're so brilliant because I fixed it already - nothing you said was suffice.

    "OH OH U CANNOT CODE INDEPENDENT LOL U IZ CRAP U FAIL" :rolleyes:

    @Matt: Originally I didn't wrap quotes around it but it doesn't really matter, don't get no syntax error.

  10. #10
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Quote Originally Posted by Excellent View Post
    Okay listen now, $conn is my function name. $connect is being used to connect to the database. Since when do $conn and $connect even come to comprehend the same word? Also why do you keep calling me "lucas" congratulations kiddy, you know my name? Oh btw stop thinking you're so brilliant because I fixed it already - nothing you said was suffice.
    Listen calm down mate. He was replying on the code that he COULD see from what you posted. How are we meant to know about any functions etc... if you havn't listed or explained it. Don't be so narrow minded.


    www.fragme.co = a project.

Page 1 of 3 123 LastLast

Posting Permissions

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