Re: mysql query/$post problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PHP Mailer wrote:
Mark skrev:
[snip]
$query = "INSERT INTO users AVATARS WHERE id =$user_id '','$avname')";
mysql_query($query);s
[snip]
I am trying to insert the value of $avname into the users table, into the avatar field.

I think what you are trying to do is coordinated a bit wrong, perhaps http://www.w3schools.com/sql/sql_insert.asp
could be of some help for you to achieve this in the future.

Taking a look at your query, i do see what you are trying to do, but the structure is wrong.

$query = "INSERT INTO users (avatars) VALUES ('$avname')WHERE id ='$user_id')";


Also - it looks like an UPDATE might be more suitable for what you want, given that you've got a WHERE clause tacked on the end. Google for a good SQL tutorial; the PHP mailing list is not the place to learn SQL :)

Jasper

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux