anon Posted December 30, 2007 Share Posted December 30, 2007 Hi, i want to know how i can write a string called $page into a database table. file_put_contents ? Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/ Share on other sites More sharing options...
kenrbnsn Posted December 30, 2007 Share Posted December 30, 2007 No, that is for writing to files. It depends on what database engine you're using. We need more information from you. Ken Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425909 Share on other sites More sharing options...
anon Posted December 30, 2007 Author Share Posted December 30, 2007 I'm using myISAM with MySql. I have a database and I want to write the string to the database. so file_put_contents isn't suitable. Should I use a MySQL query? Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425913 Share on other sites More sharing options...
kenrbnsn Posted December 30, 2007 Share Posted December 30, 2007 You really need to learn how to use MySQL from PHP. http://www.php.net/manual/en/ref.mysql.php Ken Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425917 Share on other sites More sharing options...
MadTechie Posted December 30, 2007 Share Posted December 30, 2007 While i 101% agreee with kenrbnsn, i just think its worth adding the functions your need to use are Insert (to add a record and update to update an existing record(s), if this sounds confusing them your need to readup on it. Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425921 Share on other sites More sharing options...
anon Posted December 30, 2007 Author Share Posted December 30, 2007 So would i use mysql_query("insert into Index, values ($page)"); ? Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425934 Share on other sites More sharing options...
MadTechie Posted December 30, 2007 Share Posted December 30, 2007 No, 1. Index is a reserved word 2. No , needed Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425936 Share on other sites More sharing options...
anon Posted December 30, 2007 Author Share Posted December 30, 2007 Okay, i'll change the database. mysql_query("insert into *** values ($page)"); Link to comment https://forums.phpfreaks.com/topic/83708-writing-string-to-database/#findComment-425950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.