|
-
Jul 9th, 2004, 05:14 AM
#1
Thread Starter
Frenzied Member
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. 
-
Jul 9th, 2004, 04:16 PM
#2
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.
-
Jul 9th, 2004, 10:04 PM
#3
Ex-Super Mod'rater
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.

-
Jul 10th, 2004, 03:42 AM
#4
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.
-
Jul 13th, 2004, 07:38 AM
#5
-
Jul 13th, 2004, 12:58 PM
#6
Stuck in the 80s
Originally posted by mendhak
MySQL never "qorks".
Obviously you haven't updated to the newest version.
-
Jul 17th, 2004, 12:35 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|