Re: [PHP-DB] SQL update help

2002-09-21 Thread Ignatius Reilly

When in doubt, bracket :

$sql = "UPDATE $table SET pages = '{$PHP_SELF}' WHERE session =
'{$holy_cow}'";

Less cute, but more readable.

Ignatius

- Original Message -
From: "Dave Smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 21, 2002 2:07 AM
Subject: Re: [PHP-DB] SQL update help


> Jeffrey is right, but here's an easier way:
>
> $sql = "UPDATE $table SET pages = '$PHP_SELF' WHERE session =
'$holy_cow'";
>
> Be sure you use double-quotes to build the string (so that all variables
get interpolated) and single-quotes within. Any non-numeric value has to be
quoted for an SQL statement to work properly.
>
> Good luck!
>
> --Dave
>
> [EMAIL PROTECTED] wrote:
>
> >if you put quotes around the variable $PHP_SELF it should work...try
this.
> >
> >UPDATE $table SET pages = '".$PHP_SELF."' WHERE session = $holy_cow
> >
> >hth
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] SQL update help

2002-09-20 Thread Dave Smith

Jeffrey is right, but here's an easier way:

$sql = "UPDATE $table SET pages = '$PHP_SELF' WHERE session = '$holy_cow'";

Be sure you use double-quotes to build the string (so that all variables get 
interpolated) and single-quotes within. Any non-numeric value has to be quoted for an 
SQL statement to work properly.

Good luck!

--Dave

[EMAIL PROTECTED] wrote:

>if you put quotes around the variable $PHP_SELF it should work...try this.
>
>UPDATE $table SET pages = '".$PHP_SELF."' WHERE session = $holy_cow
>
>hth
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] SQL update help

2002-09-20 Thread Jeffrey_N_Dyke


if you put quotes around the variable $PHP_SELF it should work...try this.

UPDATE $table SET pages = '".$PHP_SELF."' WHERE session = $holy_cow

hth
jd



   
 
"Jas"  
 
 cc:   
 
             Subject: [PHP-DB] SQL update help 
 
09/20/2002 
 
03:13 AM   
 
   
 
   
 




Here is my statement
UPDATE $table SET pages = $PHP_SELF WHERE session = $holy_cow
However it will not update I recieve this error:
You have an error in your SQL syntax near '/admin/login.done.php WHERE
session = 5d44389bd70881131b9ea7573eba34d4' at line 1
Any help would be appreciated
Jas



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] SQL update help

2002-09-20 Thread Jas

Here is my statement
UPDATE $table SET pages = $PHP_SELF WHERE session = $holy_cow
However it will not update I recieve this error:
You have an error in your SQL syntax near '/admin/login.done.php WHERE
session = 5d44389bd70881131b9ea7573eba34d4' at line 1
Any help would be appreciated
Jas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php