Maq Posted March 11, 2011 Share Posted March 11, 2011 ok, it works if i take out the id trying to insert. How do I make it so that it will insert. I want to take current session id id and put it into the id field in the table If you take the condition WHERE out then it will UPDATE every single record in your DB (assuming you have some). If you want to add records to the table then use INSERT not UPDATE. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186324 Share on other sites More sharing options...
searls03 Posted March 11, 2011 Author Share Posted March 11, 2011 ok. it's working now. now I Need to figure out how I, the admin, can edit anybody's profile from the internet, cause now that it works, it only will update mine, but not anyone elses. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186326 Share on other sites More sharing options...
Maq Posted March 11, 2011 Share Posted March 11, 2011 ok. it's working now. now I Need to figure out how I, the admin, can edit anybody's profile from the internet, cause now that it works, it only will update mine, but not anyone elses. You should start a new thread for this question. Provide the current code and relevant details. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186327 Share on other sites More sharing options...
Mahngiel Posted March 11, 2011 Share Posted March 11, 2011 get rid of the LIMIT 1 you have in there. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186329 Share on other sites More sharing options...
searls03 Posted March 11, 2011 Author Share Posted March 11, 2011 is there an insert/update function. If not present it inserts, if present it will update? Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186338 Share on other sites More sharing options...
Maq Posted March 11, 2011 Share Posted March 11, 2011 is there an insert/update function. If not present it inserts, if present it will update? Yes - REPLACE INTO. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186345 Share on other sites More sharing options...
searls03 Posted March 11, 2011 Author Share Posted March 11, 2011 sorry, But could you just give me an example? I am more of a visual learner that likes to see code to know how it works. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186351 Share on other sites More sharing options...
Maq Posted March 11, 2011 Share Posted March 11, 2011 sorry, But could you just give me an example? I am more of a visual learner that likes to see code to know how it works. Click the link, there are plenty of examples. Quote Link to comment https://forums.phpfreaks.com/topic/230352-why-wont-this-update-the-database/page/2/#findComment-1186384 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.