Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 11 of 11

Thread: PHP/MYSQL Help

  1. #1
    Platinum Lifetime Member
    dannywilson's Avatar
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    96
    DNF$
    109
    Bank
    0
    Total DNF$
    109
    Donate  

    PHP/MYSQL Help

    whats wrong with this

    <?php
    $username="ovt_ovt";
    $password="*****";
    $database="ovt_ovt";

    $ovt=$_POST['ovt'];
    $domain=$_POST['domain'];

    mysql_connect(localhost,$username,$password);
    @mysql_select_db($database) or die( "Unable to select database");

    $query = "INSERT INTO add (domain, ovt) VALUES ('".$domain."','".$ovt."')";

    mysql_query($query);
    echo "Query Success!";
    ?>

    its not working although it says Query Success!

  2. #2
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,243
    Bank
    0
    Total DNF$
    6,243
    Donate  

    Re: PHP/MYSQL Help

    I will ignore the BIG security issues, assuming that it's on your computer.

    try
    Code:
    mysql_connect('localhost',$username,$password);
    also,
    Code:
    mysql_query($query) or die(mysql_error());

  3. #3
    Platinum Lifetime Member
    dannywilson's Avatar
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    96
    DNF$
    109
    Bank
    0
    Total DNF$
    109
    Donate  

    Re: PHP/MYSQL Help

    afraid it dosent work
    i think its in
    $query = "INSERT INTO add (domain, ovt) VALUES ('".$domain."','".$ovt."')";

  4. #4
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,243
    Bank
    0
    Total DNF$
    6,243
    Donate  

    Re: PHP/MYSQL Help

    do you get any error after you added the second line from my first post?

  5. #5
    Platinum Lifetime Member
    dannywilson's Avatar
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    96
    DNF$
    109
    Bank
    0
    Total DNF$
    109
    Donate  

    Re: PHP/MYSQL Help

    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 'add (domain, ovt) VALUES ('DOMAIN HERE','OVT HERE')' at line 1

  6. #6
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,243
    Bank
    0
    Total DNF$
    6,243
    Donate  

    Re: PHP/MYSQL Help

    you do have a table called "add"?

  7. #7
    Platinum Lifetime Member
    dannywilson's Avatar
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    96
    DNF$
    109
    Bank
    0
    Total DNF$
    109
    Donate  

    Re: PHP/MYSQL Help

    yes and it reads from it
    www.ovtdaily.com

    i got it working!! thanks for your help
    Last edited by dannywilson; 01-18-2006 at 04:57 PM. Reason: Automerged Doublepost

  8. #8
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,243
    Bank
    0
    Total DNF$
    6,243
    Donate  

    Re: PHP/MYSQL Help

    Code:
     $query = "INSERT INTO `add`( `domain` , `ovt` ) values('".$domain."','".$ovt."')";
    mysql_query($query) or die(mysql_error());

  9. #9
    Country hopper
    katherine's Avatar
    Join Date
    Jul 2005
    Location
    Free World
    Posts
    7,499
    Country

    Iceland
    DNF$
    30,536
    Bank
    0
    Total DNF$
    30,536
    Donate  

    Re: PHP/MYSQL Help

    ADD is a mySQL reserved keyword. I guess the issue stems from the table name.
    NameNewsletter.com - free lists of available domain names
    ZoneFiles.net (beta) - ccTLD and gTLD droplists

  10. #10
    Platinum Lifetime Member
    csmaster2005's Avatar
    Join Date
    Jul 2004
    Location
    United States
    Posts
    456
    DNF$
    1,840
    Bank
    0
    Total DNF$
    1,840
    Donate  

    Re: PHP/MYSQL Help

    yes, the reason is for add. I had a similar problem a while ago.
    Additionally, putting localhost without quote tags should of returned an error, because it is not a php variable and thus wasnt set...
    Tyler Cruz schooled me in BW, so he won this until May 23rd, 2011 TylerCruz

  11. #11
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,243
    Bank
    0
    Total DNF$
    6,243
    Donate  

    Re: PHP/MYSQL Help

    works for me...

Bookmarks

Posting Permissions

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

Domain name forum recommended by Domaining.com