Re: PHP + MySQL problem (strange behavior)

2001-12-06 Thread mjriding

I've had a few queries that worked strangely worked in Mysql monitor,
but did not work from PHP.

I was able to solve every one of them by ensure that the query in PHP did
not have any line breaks in it.  It normally doesn't matter if there are
line breaks in the code, but on occassion, a line break can cause strange
results.

Hope this helps.

Mike

On Wed, 5 Dec 2001, Javier
Muniz wrote:

 Hello,
 
 I'm having trouble determining what's going wrong with a MySQL query that
 I'm doing from PHP. 
 
 I have a table with the following columns:
 id (int)
 name (varchar 20)
 starttime (int)
 duration (int)
 
 now, i have a row that has a starttime of 60, when i attempt to do the
 following update with PHP, it sets it to 0:
 
 UPDATE mytable SET starttime=starttime-30 WHERE name = 'myname'
 
 but when I run it from the MySQL command line, copy/pasted from the code, it
 sets the value of starttime to 30 as expected.  Any thoughts on where this
 problem originates from?  PHP or MySQL?  They're pretty commonly used in 
 unison so I'd imagine something like this should work fairly smoothly.  I've
 
 also posted this to the PHP list in case there's someone there that's
 encountered
 this before.
 
 Javier Muniz
 Chief Technology Officer
 Granicus, LTD.
 Tel: (415) 522-5216
 Fax: (415) 522-5215
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

-- 
Michael J. Ridinger
Lead Web Developer


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




PHP + MySQL problem (strange behavior)

2001-12-05 Thread Javier Muniz

Hello,

I'm having trouble determining what's going wrong with a MySQL query that
I'm doing from PHP. 

I have a table with the following columns:
id (int)
name (varchar 20)
starttime (int)
duration (int)

now, i have a row that has a starttime of 60, when i attempt to do the
following update with PHP, it sets it to 0:

UPDATE mytable SET starttime=starttime-30 WHERE name = 'myname'

but when I run it from the MySQL command line, copy/pasted from the code, it
sets the value of starttime to 30 as expected.  Any thoughts on where this
problem originates from?  PHP or MySQL?  They're pretty commonly used in 
unison so I'd imagine something like this should work fairly smoothly.  I've

also posted this to the PHP list in case there's someone there that's
encountered
this before.

Javier Muniz
Chief Technology Officer
Granicus, LTD.
Tel: (415) 522-5216
Fax: (415) 522-5215


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php