PRodgers4284 Posted February 15, 2008 Share Posted February 15, 2008 Im looking to use an insert query to insert values into a table, i need the query to lookup the username of the person that is logged in and add the values to the table row assigned to that user. $query = "INSERT INTO cv (name, size, type, path ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')"; I need add the followinf where statement in WHERE username='" . $_SESSION["username"] . "'")); Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted February 15, 2008 Share Posted February 15, 2008 You cannot have WHERE clauses in an INSERT. What are you doing to check against after all? Quote Link to comment Share on other sites More sharing options...
PRodgers4284 Posted February 15, 2008 Author Share Posted February 15, 2008 You cannot have WHERE clauses in an INSERT. What are you doing to check against after all? Just want values to be inserted in the correct row in the table based upon the user that is logged in Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 15, 2008 Share Posted February 15, 2008 You are looking for an UPDATE not an INSERT http://dev.mysql.com/doc/refman/5.0/en/update.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.