+ Reply to Thread
Results 1 to 9 of 9

Thread: last question, i promise, lol

  1. #1
    matzomeal is offline x10Hosting Member matzomeal is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    4

    last question, i promise, lol

    PHP Code:
    $sql "INSERT INTO $dbname.$tblname (name,password,email,user_id) VALUES($username,$pass,$email,NULL)"
    that code isn't working. anyone know why?
    Last edited by matzomeal; 05-26-2009 at 06:43 PM.

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: last question, i promise, lol

    unless you're calling

    mysql_query($sql);

    you need:

    PHP Code:
    $sql mysql_query("INSERT INTO $dbname.$tblname (name,password,email,user_id) VALUES($username,$pass,$email,NULL)"); 
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: last question, i promise, lol

    Are all of your variables defined? I.e. $dbname

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: last question, i promise, lol

    Another one: can field user_id be NULL? What's the definition for the user_id column?

  5. #5
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: last question, i promise, lol

    I've got a question, are table names case sensetive? What I mean is: is ichwar going to be different from ICHWAR or IcHwAr?

  6. #6
    zubair12 is offline Banned zubair12 is an unknown quantity at this point
    Join Date
    Feb 2009
    Location
    Lahore, Punjab, Pakistan.
    Posts
    631

    Re: last question, i promise, lol

    off course php is case sensitive

  7. #7
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: last question, i promise, lol

    Quote Originally Posted by zubair12 View Post
    off course php is case sensitive
    ok, humm, that's not good, oh well. I'll have to find a work around.

  8. #8
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: last question, i promise, lol

    Quote Originally Posted by ichwar View Post
    ok, humm, that's not good, oh well. I'll have to find a work around.
    php has the function strtolower() to make all letters lowercase and mysql has the function LOWER() which does the same.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  9. #9
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: last question, i promise, lol

    matzomeal, what do you mean by not working?

    If you mean not executing, then try as leafypiggy said.
    If you mean that you get a php error stating that a variable is not defined, then define all you variables, as lemon-tree said.
    If you are getting a false result from mysql_query, then do a var_dump on the sql variable, and copy the value in PhpMyAdmin. This will point out any error in your query.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread

Similar Threads

  1. Question game
    By ichwar in forum Forum Games
    Replies: 913
    Last Post: 12-28-2009, 06:25 AM
  2. Lottery Website (kind of)
    By admintwo in forum Earning Money
    Replies: 4
    Last Post: 12-29-2007, 05:07 PM
  3. Odd question but will I be banned for this?
    By sielk in forum Free Hosting
    Replies: 3
    Last Post: 09-28-2007, 11:29 AM
  4. Mambo question
    By MtReload in forum Free Hosting
    Replies: 5
    Last Post: 03-20-2005, 10:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers