php-windows Digest 2 Jul 2007 03:15:39 -0000 Issue 3272

Topics (messages 28164 through 28166):

Re: MySQL query error
        28164 by: Stut
        28165 by: Stut

Unable to mssql_connect unless in my office
        28166 by: Mike Beddo

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
James Blandford wrote:
Hello,
I am making a private messaging system for my website, and if you click on the pm, it --should-- set it as "read" rather than "unread". I am using the query:
UPDATE pms SET read=1 WHERE id='{$assoc['id']}'
but it is giving me this error:
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 'read=1 WHERE id='4'' at line 1 To me, this query looks perfectly fine, but obviously it isn't. Please can you tell me how to make it work.

Query looks fine. Are you sure the table and field names are correct?

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
Please include the list when replying.

James Blandford wrote:
It seems i have fixed it >_< thanks for your time thou. It turns out that I couldn't have "read" as a field name due to some random reason. I changed it to "itsread" and it works perfectly :0)

It wasn't a random reason - "read" is on the reserved words list: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

-Stut

--
http://stut.net/

----- Original Message ----- From: "Stut" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: "James Blandford" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, June 30, 2007 10:55 PM
Subject: Re: [PHP-WIN] MySQL query error


James Blandford wrote:
Hello,
I am making a private messaging system for my website, and if you click on the pm, it --should-- set it as "read" rather than "unread". I am using the query:
UPDATE pms SET read=1 WHERE id='{$assoc['id']}'
but it is giving me this error:
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 'read=1 WHERE id='4'' at line 1 To me, this query looks perfectly fine, but obviously it isn't. Please can you tell me how to make it work.

Query looks fine. Are you sure the table and field names are correct?

--- End Message ---
--- Begin Message ---
I have a very strange problem. If anyone has an insight please let me
know.

When my laptop is docked in my office I have no problem using
mssql_connect to the SQL server running on localhost. When I take my
laptop home I get the following error:

        Warning: mssql_connect() [function.mssql-connect]: Unable to
connect to server: localhost

But something like "osql -S localhost -U sa -P <passwd>" works fine!

If I connect to my office from home using checkpoint secure client then
I can connect to localhost! If I'm not connected to my office then I
can't connect to localhost.

I am using XAMPP 1.6.2 on windows xp professional SP2.

--- End Message ---

Reply via email to