Variable Assignment

Dear List -

I cannot figure this one out:

mysql> $st=1000;
ERROR 1064 (42000): 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 '$st=1000' at line 1

Ethan

MySQL 5.1 PHP 5 Linux [Debian (sid)]



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ethan Rosenberg [ Do, 28 Oktober 2010 23:10 ] [ ID #2049703 ]

Re: Variable Assignment

mysql> SET [at] st=3D100;
mysql> SELECT [at] st;
+------+
| [at] st |
+------+
| 100 |
+------+

Cheers.

On 28 October 2010 19:10, Ethan Rosenberg <ethros [at] earthlink.net> wrote:
> Dear List -
>
> I cannot figure this one out:
>
> mysql> $st=3D1000;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manua=
l
> that corresponds to your MySQL server version for the right syntax to use
> near '$st=3D1000' at line 1
>
> Ethan
>
> MySQL 5.1 =C2=A0PHP 5 =C2=A0Linux [Debian (sid)]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Andr=C3=A9s G. Monta=C3=B1ez
Zend Certified Engineer
Montevideo - Uruguay

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
andresmontanez [ Do, 28 Oktober 2010 23:13 ] [ ID #2049704 ]

Re: Variable Assignment

At 05:13 PM 10/28/2010, Andr=C3=A9s G. Monta=C3=B1ez wrote:
>mysql> SET [at] st=3D100;
>mysql> SELECT [at] st;
>+------+
>| [at] st |
>+------+
>| 100 |
>+------+
>
>Cheers.
>
>On 28 October 2010 19:10, Ethan Rosenberg <ethros [at] earthlink.net> wrote:
> > Dear List -
> >
> > I cannot figure this one out:
> >
> > mysql> $st=3D1000;
> > ERROR 1064 (42000): 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 '$st=3D1000' at line 1
> >
> > Ethan
> >
> > MySQL 5.1 =C2 PHP 5 =C2 Linux [Debian (sid)]
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>--
>Andr=C3=A9s G. Monta=C3=B1ez
>Zend Certified Engineer
>Montevideo - Uruguay

Andres -

Thanks.

It works!

However, I am totally confused. All the texts
state that to set a variable, the code is: $st=3D100;

What are they missing and what am I missing?

Ethan

MySQL 5.1 PHP 5 Linux [Debian (sid)]



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ethan Rosenberg [ Do, 28 Oktober 2010 23:55 ] [ ID #2049705 ]

Re: Variable Assignment

> However, I am totally confused. All the texts state that to set a
> variable, the code is: $st=100;

That's how you do it in php.

Doing it in the db is different and depends on the db you are using.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
dmagick [ Fr, 29 Oktober 2010 00:04 ] [ ID #2049706 ]
PHP » gmane.comp.php.database » Variable Assignment

Vorheriges Thema: printf
Nächstes Thema: Incrementing Primary Key