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 14 of 14
  1. #11
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Hmmmmmmmmmmmmmmmmm

  2. #12
    Join Date
    Aug 2006
    Location
    United Kingdom
    Posts
    207
    Tokens
    0

    Default

    Now I think the site has crashed, it wont load.
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  3. #13
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    I normally do something like this when inserting values using SQL:

    PHP Code:
    function PrepareSQLIn($val$type$defval ""$notdefval ""
    {
      
    $val = (!get_magic_quotes_gpc()) ? addslashes($val) : $val;

      switch (
    $type) {
        case 
    "text":
          
    $val = ($val != "") ? "'" $val "'" "NULL";
          break;    
        case 
    "long":
        case 
    "int":
          
    $val = ($val != "") ? intval($val) : "NULL";
          break;
        case 
    "double":
          
    $val = ($val != "") ? "'" doubleval($val) . "'" "NULL";
          break;
        case 
    "date":
          
    $val = ($val != "") ? "'" $val "'" "NULL";
          break;
        case 
    "def":
          
    $val = ($val != "") ? $defval $notdefval;
          break;
      }
      return 
    $val;
    }

    //Make the SQL query

      
    $SQLQuery sprintf("UPDATE something SET `value`=%s WHERE somethingelse=%s",
                           
    PrepareSQLIn($var1"inserttypehere"),
                           
    PrepareSQLIn($var2"inserttypehere")); 
    Feel free to use it if you give me credit ^_^
    Last edited by Tomm; 09-08-2006 at 10:15 AM.

  4. #14
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Tom i dont use a MySQL Database

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
  •