Results 1 to 7 of 7

Thread: MySQL not qorking

  1. #1

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090

    MySQL not qorking

    OK. why does this not work:
    PHP Code:
    $a $_SERVER['REMOTE_ADDR']." - ".$_SERVER['HTTP_USER_AGENT']." - ".$_SERVER['REMOTE_PORT'];
    echo 
    $a."<br />";
    $result mysql_query("INSERT INTO `jchat` (`id`, `message`, `loginid`) VALUES ('', '".$a."', ''");
    echo 
    $result
    I've used the same code on my localhost where it worked, but on the server it does nothing.

    It echo's $a fine, but nothing gets done to the database, I get no errors and the database/table do definately exist.

    I realise that the names of the fields on the mysql statement seem weird, and that I'm not using 2 of them, but this is only a temporary test thing, so I don't want to make a new table as I don't have permissions to delete them, only to create them.
    Have I helped you? Please Rate my posts.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Have you used the mysql_error () function after executing the query. If there were some kind of error in the query then it would be indicated by this function. The $result variable will be 0 if an error ocurred too.

    My quess is, it is an issue with permissions or if the database is on a UNIX server, field and table names are case sensitive.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    To use the mysql_error() function I think you also have to chnage the mysql_query(...) to @mysql_query(...). ? Not sure if thats only for the connecting functions?
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by Electroman
    To use the mysql_error() function I think you also have to chnage the mysql_query(...) to @mysql_query(...). ? Not sure if thats only for the connecting functions?
    You don't have to do that. All the @ does is surpress the error output if the function fails.

    I think mysql_query() only produces Notices on query errors (as most query errors are rcoverable) - so if you have notices disabled it won't make any difference.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    MySQL never "qorks".

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by mendhak
    MySQL never "qorks".
    Obviously you haven't updated to the newest version.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by The Hobo
    Obviously you haven't updated to the newest version.
    The upgrade is too expensive for me.

Posting Permissions

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



Click Here to Expand Forum to Full Width