Weird UPDATE Problem

Weird UPDATE Problem

am 10.10.2011 15:14:35 von forum

Hello all.
I have recently finished my migration from an older server to a newer
server running RHEL 6. The MySQL version went from=A05.0.77 to=A05.1.52.
In my application, this query used to work just fine:

$paid_query =3D mysql_query("UPDATE $table_name SET owed =3D 0 WHERE s_id
=3D $student");

Where table_name was
mysql_real_escape_string("collection_41_students"). With the new MySQL
version, the UPDATE query does not work, and echo mysql_error();
results nothing.

Is my syntax correct going from version to version?

Thanks in advance,

David

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Weird UPDATE Problem

am 10.10.2011 15:19:18 von Brandon Phelps

That query looks fine. What error are you getting if you execute the query from the CLI? Also is it possible that the s_id or owed columns are no longer numeric data types? If this column(s) is/are a character type now, then you would need to have the values in quotes.

-Brandon

On 10/10/2011 09:14 AM, D. Marshall Lemcoe Jr. wrote:
> Hello all.
> I have recently finished my migration from an older server to a newer
> server running RHEL 6. The MySQL version went from 5.0.77 to 5.1.52.
> In my application, this query used to work just fine:
>
> $paid_query = mysql_query("UPDATE $table_name SET owed = 0 WHERE s_id
> = $student");
>
> Where table_name was
> mysql_real_escape_string("collection_41_students"). With the new MySQL
> version, the UPDATE query does not work, and echo mysql_error();
> results nothing.
>
> Is my syntax correct going from version to version?
>
> Thanks in advance,
>
> David
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Weird UPDATE Problem

am 10.10.2011 16:27:30 von (Halász Sándor) hsv

>>>> 2011/10/10 09:19 -0400, Brandon Phelps >>>>
If this column(s) is/are a character type now, then you would need to have the values in quotes.
<<<<<<<<
Note that because of implicit conversion if they had numberic values no error would be reported, but maybe the equality would not be exact.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org