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"] . "'")); Link to comment https://forums.phpfreaks.com/topic/91257-insert-query-help/ 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? Link to comment https://forums.phpfreaks.com/topic/91257-insert-query-help/#findComment-467663 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 Link to comment https://forums.phpfreaks.com/topic/91257-insert-query-help/#findComment-467668 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 Link to comment https://forums.phpfreaks.com/topic/91257-insert-query-help/#findComment-467671 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.