Page 1 of 1

mysql and php

Posted: Wed Nov 25, 2009 6:03 am
by jefffan24
Hi I'm back again :( I'm trying Insert a value into my database based on what a users selects, but right now I can't even force a value into my database (like rather then using $_POST['myvalue'] I'm just trying to enter a random word in and its not even working).

Code: Select all

 
mysql_query(" INSERT INTO template_login (menus) VALUES('horizontal') WHERE username='jefffan24'");
    
 
template_login is the table, menus is the column I want to enter this value into, Values is the value I want to enter, and WHERE username='jefffan24' is column username and jefffan24 is the value in the username.

So I want to enter Horizontal into column menus for only jefffan24.

What am I doing wrong?

Re: mysql and php

Posted: Wed Nov 25, 2009 6:07 am
by jefffan24
nvm I just ended up using

UPDATE template_login SET menus='horizontal' WHERE username='jefffan24'