-
Posts
97 -
Joined
-
Last visited
Everything posted by djdellux
-
i have 4 different files that need to be used as a ?db? so when an employee needs info from them sqlite accesses the file so it can continuously be updated. is there a way to do this cuz google has all the wrong answers or maybe I'm not asking the right questions... get at me fellas thx
-
this is my if statement im proposing but i have yet to figure out the multipl file thing and making the code to be able to pull from those $pageResult = sqlite_query($dbvoip, $pageQuery); //echo $pageResult; if(isset($_GET['submitted']) && $_GET["submitted"] == "send")// line check { if ($_GET["number1"] !="") $conditions[] = " number1 =\"" .$_GET["number1"]."\""; if ($_GET["number2"] !="") $conditions[] = " number2=\"".$_GET["number2"]."\""; if ($_GET["type"] !="") $conditions[] = " type=\"".$_GET["type"]."\""; if ($_GET["number3"] !="") $conditions[] = " number3=\"".$_GET["number3"]."\""; if ($_GET["linetype"] !="") $conditions[] = " linetype=\"".$_GET["linetype"]."\""; if ($_GET["c1"] !="") $conditions[] = " c1=\"".$_GET["c1"]."\""; if ($_GET["dial"] !="") $conditions[] = " dial=\"".$_GET["dial"]."\""; if ($_GET["c2"] !="") $conditions[] = " c2=\"".$_GET["c2"]."\""; if ($_GET["date1"] !="") $conditions[] = " date1=\"".$_GET["date1"]."\""; if ($_GET["date2"] !="") $conditions[] = " date2=\"".$_GET["date2"]."\""; if ($_GET["date3"] !="") $conditions[] = " date3=\"".$_GET["dtae3"]."\""; if ($_GET["c3"] !="") $conditions[] = " c3=\"".$_GET["c3"]."\""; if ($_GET["c4"] !="") $conditions[] = " c4=\"".$_GET["c4"]."\""; if ($_GET["anw"] !="") $conditions[] = " anw=\"".$_GET["anw"]."\""; if ($_GET["Documentaion"] !="") $conditions[] = " Documentaion=\"".$_GET["Documentaion"]."\""; if ($_GET["unix"] !="") $conditions[] = " unix=\"".$_GET["unix"]."\""; ?>
-
damn clicked it to fast or something lol im making a viwer for a db that i created and now ive been informed that i need to include 4 othe files to it which will be updating on a regular basis. being that im still fairly new i know an if statement is probably the way to go but i am not 100% sure on how to accomplish it with a continuing update. heres my code if you guys could take a look at it and let me know what ya think that would be great thanks in advance <?php $dbvoip = sqlite_open($_SERVER['DOCUMENT_ROOT']."/../data/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 voiplog ( 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 voiplog "; $pageResult = sqlite_query($dbvoip, $pageQuery); echo $pageResult; ?>
-
hello all on this wonderful hump day.
-
im not at liberty to get those prgms... i do believe there is a more conventional way right??
-
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
-
still developing the same error...baahhhhh WTF?!?!?!?!
-
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
-
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???
-
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
-
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
-
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","" )
-
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)";
-
i have a qestion concerning Sqlite is that a topic that could be anwsered in here guys???
-
[SOLVED] $data =implode("','",$dbquery); ???
djdellux replied to djdellux's topic in PHP Coding Help
my whole intention is to insert info into the $dbquery variable new code after tweking does it look like this is accomplished <?php $dbvoip = sqlite_open('voip.sqlite'); 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 (C0, number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix, C17) VALUES ($dbquery)"; echo($dbquery); } sqlite_close($dbvoip) ?> -
[SOLVED] $data =implode("','",$dbquery); ???
djdellux replied to djdellux's topic in PHP Coding Help
Warning: implode() [function.implode]: Bad arguments. in c:\program files\Apache\htdocs\csv2.php on line 15 sorry bout that lol -
[SOLVED] $data =implode("','",$dbquery); ???
djdellux replied to djdellux's topic in PHP Coding Help
ie print $data ?? -
i am having trouble with a specific line of code and have been emersed in my A+ cert over the last 2 wks so any help to bring me back to the world of php would be great heres the rest of the code <?php $dbvoip = sqlite_open('voip.sqlite'); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.csv"); foreach ($dbinfo as $dbquery) { $data =implode("','",$dbquery); print_r($dbquery); exit; $dbquery = "INSERT INTO voip (C0, number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix, C17) VALUES ($data)"; } sqlite_close($dbvoip) ?>
-
Crayon Violent<><><> chk ur msgs and the line of code $dbquery =explode("','", $line); its till in there i was messin wit the stuf and when i posted it to the forum i must have left it out...
-
wow wtf is goin on.... im getting this error Database created. Notice: Undefined variable: data in c:\program files\Apache\htdocs\csv2.php on line 15 Warning: implode() [function.implode]: Bad arguments. in c:\program files\Apache\htdocs\csv2.php on line 19 Warning: implode() [function.implode]: Bad arguments. in c:\program files\Apache\htdocs\csv2.php on line 19 Warning: implode() [function.implode]: Bad arguments. in c:\program files\Apache\htdocs\csv2.php on line 19 Warning: implode() [function.implode]: Bad arguments. in c:\program files\Apache\htdocs\csv2.php on line 19 heres the code <?php $dbvoip = sqlite_open('voip.sqlite'); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.csv"); foreach ($dbinfo as $line) { $data = "'" . implode("','",$dbquery) . "'"; //print_r($dbquery); $dbquery = "INSERT INTO voip (C0, number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix, C17) VALUES ($data)"; } sqlite_close($dbvoip) ?> its driving my nuts help a newbie out man
-
thx I'm actually using sqlite and like i said early in the post i am just not familiar with it how would i go bout that??
-
any input on this code criticism is always welcome <?php $dbvoip = sqlite_open('voip.sqlite'); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.csv"); foreach ($dbinfo as $line) { echo $line; } $dbquery = explode(" ", $var); for($i = 0; $i < count($var); $i++){ echo "$i = $var[$i] <br />"; $dbquery = 'INSERT INTO voip (C0, number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix, C17) VALUES (' . $var1 . ',' . $var2 . ',' . $var3 . ',' . $var4 . ',' . $var5 . ',' . $var6 . ', ' . $var7 . ',' . $var8 . ' ,' . $var9 . ' ,' . $var10 . ',' . $var11 . ',' . $var12 . ',' . $var13 . ',' . $var14 . ',' . $var15 . ',' . $var16 . ',' . $var17 . ',' . $var18 . ')'; } sqlite_close($dbvoip) ?>
-
outa here for the day have a good one gents and ill check back in the A.M.<><><>><><><> till then.....
-
ok well im a little off with the explode\implode stuff heres what i have so far <?php $dbvoip = sqlite_open('voip.sqlite'); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.csv"); foreach ($dbinfo as $line) { echo $line; } $dbquery = 'INSERT INTO voip (C0, number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, DOCUMENTATION, unix, C17) VALUES (' . $var1 . ',' . $var2 . ',' . $var3 . ',' . $var4 . ',' . $var5 . ',' . $var6 . ', ' . $var7 . ',' . $var8 . ' ,' . $var9 . ' ,' . $var10 . ',' . $var11 . ',' . $var12 . ',' . $var13 . ',' . $var14 . ',' . $var15 . ',' . $var16 . ',' . $var17 . ',' . $var18 . ')'; $dbresult = sqlite_query($dbvoip, $dbquery); sqlite_close($dbvoip) ?> i know thats what i should use but im not sure how
-
here is an example of the excel/csv tbl C0 number1 number2 type number3 linetype c1 dial c2 date1 date2 date3 c3 c4 anw DOCUMENTATION unix C17 18005673786 15867569100 internal 18005673786 SIP/PTIline1-08f109b8 IAX2/rapidvox-5145 Dial IAX2/rapidvox/15867569100,,T 11/13/2008 14:20 11/13/2008 14:20 11/13/2008 14:20 18 5 ANSWERED DOCUMENTATION 1226586019 PTIline1 s default PTIline1 IAX2/atl-its02-14375 11/13/2008 14:22 11/13/2008 14:22 11/13/2008 14:22 1 0 ANSWERED DOCUMENTATION 1226586152 PTIline1 1517 internal "PTIline1" <PTIline1> SIP/PTIline1-08f109b8 IAX2/atl-its02-14375 Dial SIP/CSEline4,,D(1517) 11/13/2008 14:22 11/13/2008 14:22 11/13/2008 14:22 3 2 ANSWERED DOCUMENTATION 1226586152 PTIline1 1517 internal "PTIline1" <PTIline1> SIP/PTIline1-08f109b8 IAX2/atl-its02-3090 Dial SIP/CSEline4,,D(1517) 11/13/2008 14:25 11/13/2008 14:25 11/13/2008 14:25 3 2 ANSWERED DOCUMENTATION 1226586343 PTIline1 1517 internal "PTIline1" <PTIline1> SIP/PTIline1-08f109b8 IAX2/atl-its02-10920 Dial SIP/CSEline4,,D(1517) 11/13/2008 14:27 11/13/2008 14:27 11/13/2008 14:27 3 2 ANSWERED DOCUMENTATION 1226586431 PTIline1 s default PTIline1 IAX2/atl-its02-7470 11/13/2008 14:27 11/13/2008 14:27 11/13/2008 14:27 1 0 ANSWERED DOCUMENTATION 1226586464 PTIline1 1517 internal "PTIline1" <PTIline1> SIP/PTIline1-08f23418 IAX2/cse-its04-11584 Dial SIP/CSEline4,,D(1517) 11/13/2008 14:27 11/13/2008 14:27 11/13/2008 14:27 3 2 ANSWERED DOCUMENTATION 1226586464 PTIline1 s default PTIline1 IAX2/atl-its02-12742 11/13/2008 14:29 11/13/2008 14:29 11/13/2008 14:29 1 0 ANSWERED DOCUMENTATION 1226586570 PTIline1 1517 internal "PTIline1" <PTIline1> SIP/PTIline1-08f23418 IAX2/cse-its04-12179 Dial IAX2/cse-its04/1517,20,tTg 11/13/2008 14:29 11/13/2008 14:29 11/13/2008 14:29 10 9 ANSWERED DOCUMENTATION 1226586570 excuse th crudeness im really busy and multitaskin like a mad man sorry guys