RE: [PHP-DB] query fails with mysql_query but success with direct SQL from command line
| From: | John W. Holmes | Date: | Fri, 27 Sep 2002 03:39:54 +0000 |
| Subject: | RE: [PHP-DB] query fails with mysql_query but success with direct SQL from command line | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22045@lists.php.net to get a copy of this message | ||
How do you know if fails? What does mysql_error() say?
---John Holmes...
> -----Original Message-----
> From: Thoenen, Peter Mr. EPS
> [mailto:Peter.Thoenen@bondsteel2.areur.army.mil]
> Sent: Thursday, September 26, 2002 10:13 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] query fails with mysql_query but success with direct
SQL
> from command line
>
> Hello everybody,
>
> This command fails when ran with mysql_query but succeeds when ran
command
> line. Have verified connection good... a simple mysql_query("SELECT *
> FROM
> {$user}_tickets"); returns true. Any ideas?
>
> $query=mysql_query("
> SELECT *, UNIX_TIMESTAMP(date_submitted) AS n,
> UNIX_TIMESTAMP(date_updated) AS out FROM {$user}_tickets
> WHERE (
> ((UNIX_TIMESTAMP(date_submitted)-0)>259200 AND
> issue='LSR' AND date_updated IS NULL) OR
>
> ((UNIX_TIMESTAMP(date_submitted)-UNIX_TIMESTAMP(date_updated))>259200
AND
> issue='LSR' AND date_updated IS NOT NULL)
> ) OR (
> ((UNIX_TIMESTAMP(date_submitted)-0)>86400 AND
> issue='LSR' AND date_updated IS NULL) OR
>
> ((UNIX_TIMESTAMP(date_submitted)-UNIX_TIMESTAMP(date_updated))>86400
AND
> issue='LSR' and date_updated IS NOT NULL)
> );
> ");
>
> Cheers,
>
> -Peter
>
> ##################################
> Peter Thoenen - Systems Programmer
> Commercial Communications
> Camp Bondsteel, Kosovo
> ##################################
>
> "Stumbled Upon"...heh (Score:5, Funny) /.
> by $carab on 23:00 23 August 2002 (#4131637)
>
> "ForensicTec officials said they stumbled upon the military networks
about
> two months ago, while checking on network security for a
private-sector
> client."
>
> Someone new to a Dvorak probably tried to type in "lynx
> http://www.google.com" but instead got "nmap -v -p
> 1-1024 -sS -P0
army.mil
> -T paranoid".
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php