mysql and php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

mysql and php

Post 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?
jefffan24
Forum Commoner
Posts: 72
Joined: Mon Nov 02, 2009 8:18 am

Re: mysql and php

Post by jefffan24 »

nvm I just ended up using

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