Jump to content

[SOLVED] SQLITE Topics ok???


djdellux

Recommended Posts

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)";

Link to post
Share on other sites

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","" )

Link to post
Share on other sites

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???

Link to post
Share on other sites

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

Link to post
Share on other sites

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

 

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.