djdellux Posted December 15, 2008 Share Posted December 15, 2008 i have a qestion concerning Sqlite is that a topic that could be anwsered in here guys??? Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/ Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 I have to insert this into sqlite its a list of the table names from my php code i am now running in the sqlite cmd. with my voip.db open do you know how i would go about puting this into it via cmd so it would creat these tables thx in advance $dbquery = "INSERT INTO voip.db ( number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix) VALUES ($dbquery)"; Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715873 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 This is not a query that would create a table... This is a query that inserts values into existing table... Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715904 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 how woul i create that table here is an example of the data and tbl names number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix ("","CSEline7","1356","inter-company","""CSEline7"" ","IAX2/cse-its04-2318","SIP/PTIline3-08cdf068","Dial","SIP/PTIline3,,D(1356)","2008-12-03 09:07:29","2008-12-03 09:07:32","2008-12-03 09:10:44",195,192,"ANSWERED","DOCUMENTATION","1228295249.897","" ) Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715923 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Try SQLite manager or SQLiteManager (darn, these people are not at all original when it comes to names) Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715926 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 i actually need to know how to do it old skool so i can understand the concept before i get a prgm that will do it for me if ya know what i mean...thx for those i will utilize them later Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715936 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 I suppose you're after CREATE TABLE syntax Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715943 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 yeah but i am not sure how to CREATE TABLE(enter the info in here???) lol if your picking up what im puting down mate Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715957 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Diagrams on that page explain syntax quite good. You would do something like this CREATE TABLE tablename (columnname1 datatype1, columnname2 datatype2, ...); See here: http://www.sqlite.org/datatype3.html for available datatypes in sqlite Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715963 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 CREATE TABLE voiplog (number1 TEXT , number2 INTERGER, type TEXT , number3 TEXT, linetype TEXT, c1 TEXT, dial TEXT, c2 TEXT, date1 INTERGER, date2 INTERGER,date3 INTERGER, c3 TEXT, c4 TEXT, anw TEXT, Documentaion TEXT, unix REAL) i did this and now excuted code and its still giving an error Warning: sqlite_query() [function.sqlite-query]: no such table: voiplog in c:\program files\Apache\htdocs\csv2.php on line 32 would you like to see my php??? Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-715993 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Sure Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716001 Share on other sites More sharing options...
fenway Posted December 15, 2008 Share Posted December 15, 2008 Sure Let's not and say we did... only post SMALL, RELEVANT code snippets -- NOT the entire file. Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716027 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 ok heres a limited version lol <?php $dbvoip = sqlite_open('voip.db'); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.csv"); foreach ($dbinfo as $dbquery); { //$data =implode(",",$dbquery); $dbquery = "INSERT INTO voip.db ( number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, Documentaion, unix) VALUES ($dbquery)"; //echo($dbquery); } //sqlite_close($dbvoip) $pageQuery = "SELECT * FROM number1 "; $pageResult = sqlite_query($dbvoip, $pageQuery); echo $pageResult; ?> I am stressing cuz im new and i think that i should have this stuff down but...lol Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716040 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Hold on. Your database is called 'voip.id' Your table is called 'voiplog' So your insert query should look like INSERT INTO voiplog (... and your select query SELECT number1 FROM voiplog Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716046 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 still developing the same error...baahhhhh WTF?!?!?!?! Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716113 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Use one of the tools I suggested above, to check if the table was indeed created. Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716122 Share on other sites More sharing options...
djdellux Posted December 15, 2008 Author Share Posted December 15, 2008 tools suggested above???? sorry its been a ery long day we had too many layoffs and my head just isnt here lol thx for understanding Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716149 Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 SQLiteManager and/or SQLite Manager Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716161 Share on other sites More sharing options...
djdellux Posted December 16, 2008 Author Share Posted December 16, 2008 im not at liberty to get those prgms... i do believe there is a more conventional way right?? Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716730 Share on other sites More sharing options...
Mchl Posted December 16, 2008 Share Posted December 16, 2008 Who limits you in getting those? ??? Quote Link to comment https://forums.phpfreaks.com/topic/137068-solved-sqlite-topics-ok/#findComment-716817 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.